/* ==========================================================================
   GreatAutomate — user dashboard (/app)
   ========================================================================== */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.app-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.app-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.app-header .brand { font-size: var(--fs-md); }
.app-nav { display: flex; align-items: center; gap: 2px; }
.app-nav a { padding: 7px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.app-nav a:hover { color: var(--text); background: var(--surface-2); }
.app-nav a.active { color: var(--primary); background: var(--primary-soft); }
@media (max-width: 420px) { .app-nav a { padding: 6px 8px; } }
.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); }
.user-chip .avatar { width: 30px; height: 30px; font-size: 11px; }
.user-chip .who { display: none; line-height: 1.15; }
.user-chip .who b { display: block; font-size: var(--fs-sm); }
.user-chip .who span { font-size: 11px; color: var(--text-3); }
@media (min-width: 760px) { .user-chip .who { display: block; } }
.app-main { flex: 1; padding: 24px 0 64px; }
@media (min-width: 900px) { .app-main { padding: 32px 0 80px; } }

/* Page head */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-title { font-size: var(--fs-2xl); letter-spacing: -0.02em; margin-bottom: 4px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .dash-title { font-size: var(--fs-xl); } .dash-head .btn { width: 100%; } }

.app-grid { display: grid; gap: 20px; }
@media (min-width: 1000px) { .app-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; } }
.app-content { min-width: 0; }
.app-side { display: grid; gap: 16px; }
@media (min-width: 1000px) { .app-side { position: sticky; top: 88px; } }

/* Quota card */
.quota { display: flex; align-items: center; gap: 18px; }
.quota .ring { width: 92px; height: 92px; }
.quota-meta { min-width: 0; }
.quota-meta .big { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.quota-meta .big small { font-size: var(--fs-md); color: var(--text-3); font-weight: 600; }
.quota-meta p { font-size: var(--fs-xs); margin-top: 6px; }
.plan-card { display: flex; align-items: center; gap: 12px; }
.plan-card .stat-icon { width: 40px; height: 40px; }
.plan-card b { display: block; }
.plan-card span { font-size: var(--fs-xs); color: var(--text-3); }

/* Quick tools */
#quickTools { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 640px) { #quickTools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } #quickTools .tool-mini { padding: 9px 10px; } }

/* Recent files */
.hist-table td { vertical-align: middle; }
.hist-table .hist-file { font-family: var(--mono); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.hist-table td a { color: var(--text); }
.hist-table td a:hover { color: var(--primary); }
.hist-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.hist-actions .btn-icon:hover { color: var(--danger); background: var(--danger-soft); }
.hist-action-cell { text-align: right; }
@media (min-width: 761px) and (max-width: 1100px) { .hist-actions .btn-soft span { display: none; } }
@media (max-width: 760px) { .hist-table td.actions .hist-actions { width: 100%; } .hist-table td.actions .btn-soft { flex: 1; justify-content: center; } }

/* Pending */
.pending-hero { text-align: center; padding: 40px 20px; }
.pending-hero .stat-icon { width: 64px; height: 64px; border-radius: var(--r-lg); margin: 0 auto 18px; }
.pending-hero .stat-icon .icon { width: 30px; height: 30px; }
.pending-hero h2 { font-size: var(--fs-xl); margin-bottom: 8px; }
.pending-hero p { max-width: 460px; margin: 0 auto; }

/* Tips */
.tips { display: grid; gap: 10px; }
.tip { display: flex; gap: 10px; font-size: var(--fs-xs); color: var(--text-2); line-height: 1.5; }
.tip[hidden] { display: none; }
.tip .icon { color: var(--primary); flex: 0 0 auto; margin-top: 1px; width: 15px; height: 15px; }
.tip code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

/* Small screens: keep the header on one line */
.app-content .card-header { flex-wrap: nowrap; }
.app-content .card-header > div:first-child { min-width: 0; }
.app-content .card-header > .btn { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 480px) {
    .app-header .container { gap: 8px; }
    .app-header .container > .flex { gap: 6px; }
    .app-nav a.active { display: none; }
    .user-chip { gap: 4px; padding: 3px; }
}
