/* ============================================
   KAMILA CARDOSO - SISTEMA DE ORÇAMENTOS
   Design Premium & Elegante
   ============================================ */

/* === VARIÁVEIS DE DESIGN === */
:root {
    /* Cores principais */
    --ink: #1a1614;
    --brown: #2b1d18;
    --brown-light: #3d2a23;
    --brown-soft: #6b5248;
    --beige: #f8f4ef;
    --beige-warm: #f3ebe0;
    --nude: #e8d5c4;
    --gold: #c9a55c;
    --gold-light: #d4b876;
    --gold-dark: #a88a45;
    --white: #fffdf9;
    --muted: #8a7e77;
    --line: #e8ddd0;
    --line-light: #f0e8de;
    
    /* Status */
    --success: #4a9d6e;
    --success-bg: #e8f5ed;
    --warning: #d4a24c;
    --warning-bg: #fef8eb;
    --danger: #c45454;
    --danger-bg: #fdf0f0;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(43, 29, 24, .06);
    --shadow-md: 0 8px 24px rgba(43, 29, 24, .08);
    --shadow-lg: 0 16px 48px rgba(43, 29, 24, .12);
    --shadow-xl: 0 24px 64px rgba(43, 29, 24, .16);
    --shadow-gold: 0 8px 24px rgba(201, 165, 92, .25);
    --shadow-inset: inset 0 2px 4px rgba(43, 29, 24, .04);
    
    /* Bordas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transições */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tipografia */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
html { 
    -webkit-text-size-adjust: 100%; 
    scroll-behavior: smooth;
}
body { 
    margin: 0; 
    font-family: var(--font-sans); 
    color: var(--ink); 
    background: var(--beige);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { 
    color: inherit; 
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--gold); }
img { max-width: 100%; display: block; }
::selection { background: var(--gold); color: var(--white); }

/* === LAYOUT PRINCIPAL === */
.app-shell { 
    min-height: 100vh; 
    display: grid; 
    grid-template-columns: 280px 1fr;
}

/* === SIDEBAR === */
.sidebar { 
    background: linear-gradient(180deg, var(--brown) 0%, var(--brown-light) 100%);
    color: var(--white); 
    padding: 28px 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 32px; 
    position: sticky; 
    top: 0; 
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

.brand { 
    display: flex;
    flex-direction: column;
    gap: 12px; 
    font-weight: 600; 
    letter-spacing: .03em; 
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand img { 
    max-height: 52px; 
    object-fit: contain; 
    object-position: left;
    filter: brightness(1.05);
}
.brand span { 
    font-size: 11px;
    color: var(--nude);
    letter-spacing: .12em;
}

.sidebar nav { 
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sidebar nav a { 
    color: rgba(255,255,255,.75); 
    padding: 14px 16px; 
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
    position: relative;
}
.sidebar nav a::before {
    content: '';
    width: 4px;
    height: 0;
    background: var(--gold);
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: height var(--transition-fast);
}
.sidebar nav a:hover { 
    background: rgba(255,255,255,.08); 
    color: #fff;
    transform: translateX(4px);
}
.sidebar nav a.active { 
    background: rgba(255,255,255,.12); 
    color: #fff;
    font-weight: 600;
}
.sidebar nav a.active::before { height: 24px; }

.primary-link { 
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%) !important;
    color: var(--brown) !important; 
    font-weight: 700 !important;
    box-shadow: var(--shadow-gold);
    margin-top: 8px;
}
.primary-link:hover {
    transform: translateX(0) scale(1.02) !important;
    box-shadow: 0 12px 28px rgba(201, 165, 92, .35);
}

.sidebar-footer { 
    margin-top: auto; 
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-footer span { 
    color: var(--nude); 
    padding: 0 16px 8px;
    font-size: 13px;
    font-weight: 500;
}
.sidebar-footer a { 
    color: rgba(255,255,255,.6);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all var(--transition-fast);
}
.sidebar-footer a:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}

/* === ÁREA PRINCIPAL === */
.main { 
    padding: 40px; 
    min-width: 0;
    background: linear-gradient(180deg, var(--beige) 0%, var(--beige-warm) 100%);
}

/* === TOPBAR === */
.topbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 24px; 
    margin-bottom: 32px;
}
.topbar > div { display: flex; flex-direction: column; gap: 4px; }
.topbar h1, h1, h2, h3 { 
    margin: 0; 
    color: var(--brown);
    font-family: var(--font-display);
    font-weight: 700;
}
.topbar h1 { 
    font-size: 32px;
    letter-spacing: -0.02em;
}
h2 { font-size: 24px; }
h3 { font-size: 18px; }

.eyebrow { 
    margin: 0; 
    text-transform: uppercase; 
    font-size: 11px; 
    letter-spacing: .2em; 
    color: var(--gold); 
    font-weight: 700;
    font-family: var(--font-sans);
}

/* === BOTÕES === */
.button, button { 
    border: 0; 
    cursor: pointer; 
    border-radius: var(--radius-md); 
    padding: 14px 24px; 
    min-height: 48px; 
    font-weight: 600; 
    font-size: 14px; 
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px;
    font-family: var(--font-sans);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}
.button::after, button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.15) 0%, transparent 50%);
    pointer-events: none;
}

.button.gold, button.gold { 
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--brown); 
    box-shadow: var(--shadow-gold);
    text-shadow: 0 1px 0 rgba(255,255,255,.2);
}
.button.gold:hover, button.gold:hover { 
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(201, 165, 92, .4);
}
.button.gold:active, button.gold:active {
    transform: translateY(0);
}

.button.ghost, button.ghost, .mini-button { 
    border: 1.5px solid var(--line); 
    background: var(--white); 
    color: var(--brown);
    box-shadow: var(--shadow-sm);
}
.button.ghost:hover, button.ghost:hover, .mini-button:hover { 
    border-color: var(--gold);
    color: var(--gold-dark);
    box-shadow: var(--shadow-md);
}

.button.full { width: 100%; }

.mini-button {
    padding: 10px 16px;
    min-height: 40px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* === PAINÉIS E CARDS === */
.panel, .stat, .hero-action, .client-summary { 
    background: var(--white); 
    border: 1px solid var(--line-light); 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}
.panel:hover, .stat:hover { box-shadow: var(--shadow-lg); }

.panel { 
    padding: 28px; 
    margin-bottom: 24px;
}
.panel.narrow { max-width: 720px; }

.panel-title { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 16px; 
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-light);
}
.panel-title h2 {
    display: flex;
    align-items: center;
    gap: 12px;
}
.panel-title span, .panel-title a { 
    color: var(--muted); 
    font-size: 13px;
    font-weight: 500;
}
.panel-title a:hover { color: var(--gold); }

/* === ESTATÍSTICAS === */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 20px; 
    margin-bottom: 28px;
}
.stat { 
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}
.stat:hover::before { opacity: 1; }
.stat span { 
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.stat strong { 
    display: block; 
    font-size: 42px; 
    color: var(--brown); 
    margin-top: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* === HERO ACTION === */
.hero-action, .client-summary { 
    padding: 32px; 
    margin-bottom: 28px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 24px; 
    background: linear-gradient(135deg, var(--white) 0%, var(--beige-warm) 50%, var(--nude) 100%);
    border: none;
    position: relative;
    overflow: hidden;
}
.hero-action::before, .client-summary::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(201, 165, 92, .15) 0%, transparent 70%);
    pointer-events: none;
}
.hero-action h2 { 
    max-width: 760px; 
    font-size: 26px;
    line-height: 1.35;
}
.client-summary strong { 
    font-size: 36px; 
    color: var(--gold);
    font-family: var(--font-display);
}

/* === FORMULÁRIOS === */
.form-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 20px;
}
.form-grid.three { 
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

label { 
    display: flex;
    flex-direction: column;
    gap: 8px; 
    color: var(--brown-soft); 
    font-size: 12px; 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

input, textarea, select { 
    width: 100%; 
    border: 1.5px solid var(--line); 
    background: var(--white); 
    color: var(--ink); 
    border-radius: var(--radius-md); 
    padding: 14px 16px; 
    font: inherit; 
    font-size: 15px; 
    min-height: 50px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-inset);
}
input:hover, textarea:hover, select:hover {
    border-color: var(--nude);
}
input:focus, textarea:focus, select:focus { 
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(201, 165, 92, .15), var(--shadow-inset);
}
input::placeholder, textarea::placeholder {
    color: var(--muted);
    opacity: .6;
}

textarea { 
    min-height: 120px; 
    resize: vertical;
    line-height: 1.6;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b5248' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

.wide { grid-column: 1 / -1; }

/* === ESCOLHAS / CHECKBOXES === */
.choice-row { 
    display: flex; 
    gap: 14px; 
    flex-wrap: wrap; 
    margin-bottom: 24px;
}
.choice { 
    display: inline-flex; 
    align-items: center; 
    gap: 12px; 
    padding: 14px 18px; 
    border: 1.5px solid var(--line); 
    background: var(--white); 
    border-radius: var(--radius-md); 
    color: var(--brown);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.choice:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
}
.choice:has(input:checked) {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201, 165, 92, .08) 0%, rgba(201, 165, 92, .04) 100%);
    box-shadow: 0 0 0 3px rgba(201, 165, 92, .12);
}
.choice input { 
    width: 20px;
    height: 20px;
    min-height: auto; 
    accent-color: var(--gold);
    cursor: pointer;
}

/* === PAINÉIS DE ÁREA === */
.area-panel { 
    display: none; 
    border-top: 1px solid var(--line-light); 
    padding-top: 28px; 
    margin-top: 24px;
    animation: fadeIn var(--transition-base);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.area-panel.active { display: block; }
.area-panel h3, .settings-heading { 
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
}

/* === TABELAS === */
.table-wrap { 
    overflow-x: auto;
    border-radius: var(--radius-md);
}
table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 720px;
}
th { 
    text-align: left; 
    color: var(--brown-soft); 
    font-size: 11px; 
    text-transform: uppercase; 
    letter-spacing: .1em;
    font-weight: 700;
    background: var(--beige-warm);
}
td, th { 
    padding: 16px 14px; 
    border-bottom: 1px solid var(--line-light);
}
tbody tr {
    transition: background var(--transition-fast);
}
tbody tr:hover {
    background: rgba(201, 165, 92, .04);
}
tbody tr:last-child td { border-bottom: none; }

/* === BADGES === */
.badge, .tag-row span { 
    display: inline-flex; 
    padding: 6px 12px; 
    border-radius: var(--radius-full); 
    background: linear-gradient(135deg, var(--beige-warm) 0%, var(--nude) 100%);
    color: var(--brown); 
    font-weight: 600; 
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* === AÇÕES === */
.actions { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    font-size: 12px;
}
.actions a { 
    color: var(--brown-soft); 
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--beige-warm);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.actions a:hover {
    background: var(--gold);
    color: var(--brown);
}
.actions .danger { 
    color: var(--danger);
    background: var(--danger-bg);
}
.actions .danger:hover {
    background: var(--danger);
    color: var(--white);
}

/* === FOTOS === */
.photo-rows { 
    display: grid; 
    gap: 16px; 
    margin-bottom: 20px;
}
.photo-row { 
    display: grid; 
    grid-template-columns: 100px 1.1fr 1fr 1fr auto; 
    gap: 14px; 
    align-items: center;
    padding: 16px;
    background: var(--beige-warm);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-light);
}
.upload-preview { 
    width: 100px; 
    height: 75px; 
    object-fit: contain; 
    background: var(--white);
    border-radius: var(--radius-sm); 
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
}

.inline { 
    display: inline-flex; 
    align-items: center; 
    gap: 10px; 
    white-space: nowrap;
    font-weight: 500;
    color: var(--brown-soft);
}
.inline input { 
    width: 18px;
    height: 18px;
    min-height: auto;
}

.photo-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 18px;
}
.photo-grid.small { 
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
    margin-bottom: 20px;
}
.photo-grid figure { 
    margin: 0; 
    border: 1px solid var(--line-light); 
    border-radius: var(--radius-md); 
    overflow: hidden; 
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}
.photo-grid figure:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.photo-grid img { 
    width: 100%; 
    aspect-ratio: 4/3; 
    object-fit: contain;
    background: var(--white);
}
figcaption { 
    padding: 14px; 
    color: var(--muted); 
    font-size: 13px;
    background: var(--beige-warm);
}
figcaption input, figcaption select {
    margin-top: 8px;
    min-height: 42px;
    font-size: 13px;
}

/* === AÇÕES FIXAS === */
.sticky-actions { 
    position: sticky; 
    bottom: 0; 
    background: linear-gradient(180deg, rgba(248, 244, 239, 0) 0%, rgba(248, 244, 239, .95) 20%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 0 8px; 
    display: flex; 
    justify-content: flex-end; 
    gap: 14px; 
    z-index: 10;
}

/* === NOTIFICAÇÕES === */
.notice, .alert { 
    padding: 16px 20px; 
    border-radius: var(--radius-md); 
    margin-bottom: 20px; 
    background: var(--warning-bg);
    color: var(--brown); 
    border-left: 4px solid var(--warning);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}
.notice::before {
    content: '✓';
    width: 24px;
    height: 24px;
    background: var(--warning);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.alert { 
    background: var(--danger-bg);
    border-color: var(--danger);
}
.alert::before {
    content: '!';
    background: var(--danger);
}

/* === PÁGINA DE LOGIN === */
.login-page { 
    min-height: 100vh; 
    display: grid; 
    place-items: center; 
    padding: 24px; 
    background: 
        radial-gradient(ellipse at top left, rgba(201, 165, 92, .15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(232, 213, 196, .3) 0%, transparent 50%),
        linear-gradient(135deg, var(--brown) 0%, var(--brown-light) 100%);
}
.login-card { 
    width: min(480px, 100%); 
    background: var(--white); 
    padding: 48px 40px; 
    border-radius: var(--radius-xl); 
    box-shadow: var(--shadow-xl);
    position: relative; 
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
}
.login-mark { 
    position: absolute; 
    right: -30px; 
    top: -30px; 
    width: 180px; 
    opacity: .06;
    transform: rotate(15deg);
}
.login-logo { 
    max-height: 64px; 
    margin-bottom: 32px;
}
.login-card .eyebrow {
    margin-bottom: 8px;
}
.login-card h1 { 
    font-size: 28px; 
    margin-bottom: 28px;
    line-height: 1.3;
}
.login-card .form-grid {
    gap: 18px;
}
.login-card .button {
    margin-top: 8px;
}

/* === CONFIGURAÇÕES === */
.settings-tabs { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    margin-bottom: 24px;
    padding: 6px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.settings-tabs a { 
    padding: 12px 20px; 
    background: transparent;
    border: none;
    border-radius: var(--radius-md); 
    font-weight: 600; 
    color: var(--muted);
    font-size: 13px;
    transition: all var(--transition-fast);
}
.settings-tabs a:hover {
    color: var(--brown);
    background: var(--beige-warm);
}
.settings-tabs a.active { 
    background: linear-gradient(135deg, var(--brown) 0%, var(--brown-light) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* === BUSCA === */
.search { 
    display: flex; 
    gap: 12px;
}
.search input {
    flex: 1;
}

/* === TAGS === */
.tag-row { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    margin-top: 16px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 920px) {
    .app-shell { grid-template-columns: 1fr; }
    
    .sidebar { 
        position: sticky; 
        top: 0; 
        height: auto; 
        padding: 16px 20px; 
        gap: 16px; 
        z-index: 100;
        background: var(--brown);
        box-shadow: var(--shadow-lg);
    }
    .brand { 
        flex-direction: row;
        align-items: center; 
        gap: 12px;
        padding-bottom: 0;
        border-bottom: none;
    }
    .brand img { max-height: 38px; max-width: 160px; }
    .brand span { font-size: 10px; }
    
    .sidebar nav { 
        flex-direction: row;
        gap: 6px; 
        overflow-x: auto; 
        padding-bottom: 4px; 
        scrollbar-width: none;
        margin: 0 -20px;
        padding: 0 20px 4px;
    }
    .sidebar nav::-webkit-scrollbar { display: none; }
    .sidebar nav a { 
        white-space: nowrap; 
        flex: 0 0 auto; 
        min-height: 44px;
        padding: 10px 14px;
    }
    .sidebar nav a::before { display: none; }
    .sidebar nav a:hover { transform: none; }
    
    .sidebar-footer { 
        flex-direction: row;
        align-items: center; 
        gap: 12px; 
        overflow-x: auto; 
        margin-top: 0; 
        padding-top: 12px;
    }
    .sidebar-footer span { padding: 0; white-space: nowrap; }
    .sidebar-footer a { padding: 8px 12px; white-space: nowrap; }
    
    .main { padding: 24px; }
    
    .topbar, .hero-action, .client-summary, .panel-title { 
        align-items: flex-start; 
        flex-direction: column;
    }
    
    .stats-grid, .form-grid.three { grid-template-columns: 1fr; }
    
    .photo-row { grid-template-columns: 1fr; }
    .upload-preview { width: 100%; height: auto; aspect-ratio: 16/9; }
    
    .sticky-actions { justify-content: stretch; }
    .sticky-actions .button, .sticky-actions button { flex: 1; }
}

@media (max-width: 640px) {
    body { background: var(--beige-warm); }
    
    .main { 
        padding: 16px; 
        padding-bottom: 100px;
    }
    
    .topbar { margin-bottom: 20px; gap: 14px; }
    .topbar h1 { font-size: 24px; line-height: 1.2; }
    .topbar .button { width: 100%; }
    
    .eyebrow { font-size: 10px; letter-spacing: .15em; }
    
    .panel { 
        padding: 20px; 
        margin-bottom: 16px; 
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
    }
    .panel-title { 
        gap: 10px; 
        margin-bottom: 18px;
        padding-bottom: 14px;
    }
    .panel-title h2 { font-size: 20px; }
    .panel-title span, .panel-title a { font-size: 12px; }
    
    .stats-grid { gap: 12px; margin-bottom: 18px; }
    .stat { padding: 18px; }
    .stat strong { font-size: 32px; }
    
    .hero-action, .client-summary { 
        padding: 22px; 
        margin-bottom: 18px;
        border-radius: var(--radius-md);
    }
    .hero-action h2 { font-size: 20px; line-height: 1.35; }
    .client-summary strong { font-size: 28px; }
    
    .choice-row { gap: 10px; margin-bottom: 16px; }
    .choice { 
        width: 100%; 
        min-height: 52px; 
        justify-content: flex-start;
    }
    
    .form-grid { gap: 14px; }
    label { font-size: 11px; }
    input, textarea, select { 
        min-height: 48px;
        padding: 12px 14px;
    }
    textarea { min-height: 100px; }
    
    .area-panel { padding-top: 20px; margin-top: 18px; }
    .area-panel h3, .settings-heading { font-size: 17px; }
    
    .table-wrap { 
        margin: 0 -20px; 
        padding: 0 20px 8px; 
        -webkit-overflow-scrolling: touch;
    }
    table { min-width: 640px; }
    td, th { padding: 12px 10px; }
    
    .actions { gap: 6px; }
    .actions a { 
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .photo-grid { grid-template-columns: 1fr; }
    .photo-grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    figcaption { padding: 12px; }
    
    .photo-row { 
        padding: 14px; 
        border-radius: var(--radius-md);
    }
    .upload-preview { max-height: 200px; }
    
    .inline { white-space: normal; min-height: 44px; }
    
    .sticky-actions { 
        position: fixed; 
        left: 0; 
        right: 0; 
        bottom: 0; 
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
        background: rgba(43, 29, 24, .96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(255,255,255,.1);
    }
    .sticky-actions .button, .sticky-actions button { min-height: 52px; }
    .sticky-actions .ghost { 
        border-color: rgba(255,255,255,.2); 
        background: rgba(255,255,255,.08); 
        color: var(--white);
    }
    .sticky-actions .ghost:hover {
        background: rgba(255,255,255,.15);
        border-color: rgba(255,255,255,.3);
    }
    
    .settings-tabs { 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        padding: 4px;
        gap: 4px;
    }
    .settings-tabs a { 
        white-space: nowrap; 
        flex: 0 0 auto; 
        min-height: 44px;
        padding: 10px 16px;
    }
    
    .search { 
        width: 100%; 
        flex-direction: column;
    }
    .search .button, .search button { width: 100%; }
    
    .login-page { padding: 16px; align-items: stretch; }
    .login-card { 
        margin: auto 0; 
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }
    .login-card h1 { font-size: 24px; }
    .login-logo { max-height: 52px; margin-bottom: 28px; }
}

@media (max-width: 380px) {
    .main { padding-left: 12px; padding-right: 12px; }
    .panel { padding: 16px; }
    .topbar h1 { font-size: 22px; }
    .stat strong { font-size: 28px; }
    .photo-grid.small { grid-template-columns: 1fr; }
    .sticky-actions { 
        gap: 10px; 
        padding-left: 12px; 
        padding-right: 12px;
    }
    .button, button { padding-left: 14px; padding-right: 14px; }
}

/* === ANIMAÇÕES EXTRAS === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel { animation: slideUp var(--transition-slow); }
.stat { animation: slideUp var(--transition-slow); }
.stat:nth-child(2) { animation-delay: 50ms; }
.stat:nth-child(3) { animation-delay: 100ms; }

/* === SCROLLBAR CUSTOMIZADA === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--beige-warm); }
::-webkit-scrollbar-thumb { 
    background: var(--nude); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--brown-soft); }

/* === FOCUS VISIBLE === */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.form-hint {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 18px;
}
.form-hint a { color: var(--gold); font-weight: 700; }

.conditional-hidden { display: none; }
