/* ============================================================
   Central de Arquivos NF ??" Design System
   Identidade Visual: Grupo N?s?F
   ============================================================ */

:root {
    --primary:        #6366f1;
    --primary-dark:   #4f46e5;
    --primary-light:  #818cf8;
    --secondary:      #ec4899;
    --secondary-light:#f472b6;
    --success:  #10b981;
    --warning:  #f59e0b;
    --danger:   #ef4444;
    --info:     #3b82f6;
    --text-primary:   #1f2937;
    --text-secondary: #6b7280;
    --text-light:     #9ca3af;
    --bg-primary:     #ffffff;
    --bg-secondary:   #f9fafb;
    --bg-tertiary:    #f3f4f6;
    --border:         #e5e7eb;
    --shadow-sm:  0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,.1);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.1);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-nf: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text-primary); background: var(--bg-secondary); line-height: 1.6; min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
    background: var(--gradient-nf); color: #fff; padding: 0 2rem; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-lg);
}
.navbar-brand { display: flex; align-items: center; gap: .75rem; color: #fff; font-size: 1.1rem; font-weight: 700; text-decoration: none; }
.navbar-brand:hover { text-decoration: none; }
.logo-box { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.logo-box-bg {
    width: 100%; height: 100%; border-radius: 12px;
    background: #000;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 0 18px rgba(99,102,241,.3), 0 0 0 1px rgba(251,191,36,.08), inset 0 1px 0 rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center; gap: 1px;
}
.logo-n, .logo-f {
    font-size: 15px; font-weight: 900; letter-spacing: -0.5px;
    color: #fff; line-height: 1; font-family: inherit;
}
.logo-bolt-inline {
    font-size: 13px; color: #fbbf24; line-height: 1;
    filter: drop-shadow(0 0 5px rgba(251,191,36,.85));
    animation: boltPulse 2s ease-in-out infinite; display: inline-block;
}
@keyframes boltPulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(251,191,36,.7)); } 50% { transform: scale(1.2); filter: drop-shadow(0 0 9px rgba(251,191,36,1)); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1rem; font-weight: 700; color: #fff; }
.brand-sub  { font-size: .72rem; color: rgba(255,255,255,.7); font-weight: 400; }
.navbar-actions { display: flex; align-items: center; gap: .65rem; }
.navbar-user {
    display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: rgba(255,255,255,.85);
    padding: .35rem .75rem; border-radius: 10px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
}

.btn {
    display: inline-flex; align-items: center; gap: .35rem; padding: .45rem 1rem; border-radius: 10px;
    font-size: .86rem; font-weight: 600; cursor: pointer; border: 1.5px solid transparent;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1); white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gradient-nf); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,.55); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-outline-dark { background: transparent; color: #6366f1; border-color: #6366f1; }
.btn-outline-dark:hover { background: #6366f1; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,.4); }
.btn-success { background: #10b981; color: #fff; border-color: #10b981; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; border-radius: 6px; }
.btn-xs { padding: .18rem .5rem; font-size: .75rem; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }
.btn-link { background: none; border: none; color: rgba(255,255,255,.7); font-size: .82rem; cursor: pointer; padding: 0; }
.btn-link:hover { color: #fff; text-decoration: underline; }

.container { max-width: 1400px; margin: 0 auto; padding: 1.75rem 1.5rem; }
.container-narrow { max-width: 660px; }
.layout-main { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; margin-top: 1.25rem; }
@media (max-width: 860px) { .layout-main { grid-template-columns: 1fr; } }

.sidebar {
    background: #fff; border-radius: 14px; box-shadow: var(--shadow-md); padding: 1.25rem;
    height: fit-content; border: 1px solid var(--border);
}
.sidebar-title { font-size: .8rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .75rem; }
.pasta-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.pasta-item {
    display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-radius: 10px;
    font-size: .87rem; color: var(--text-secondary); transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.pasta-item:hover { background: var(--bg-tertiary); color: var(--text-primary); text-decoration: none; }
.pasta-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(236,72,153,.08));
    color: #6366f1; font-weight: 700; border: 1px solid rgba(99,102,241,.2);
}
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: .75rem 0; }

.card { background: #fff; border-radius: 14px; box-shadow: var(--shadow-md); padding: 1.5rem; border: 1px solid var(--border); }

.page-header { margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.page-header h2 { font-size: 1.35rem; font-weight: 800; }
.content-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.content-header h2 { font-size: 1.1rem; font-weight: 700; }

.filters-bar { background: #fff; border-radius: 14px; padding: 1rem 1.25rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.search-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.search-form .form-control { flex: 1; min-width: 240px; }

.arquivo-grid { display: flex; flex-direction: column; gap: .75rem; }
.arquivo-card {
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.arquivo-card:hover { box-shadow: var(--shadow-lg); border-color: #818cf8; transform: translateY(-1px); }
.arquivo-icon {
    font-size: 2rem; flex-shrink: 0; width: 52px; height: 52px; border-radius: 10px;
    background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border);
}
.arquivo-info { flex: 1; min-width: 0; }
.arquivo-nome { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arquivo-desc { font-size: .82rem; color: var(--text-secondary); margin-top: .15rem; }
.arquivo-meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .76rem; color: var(--text-light); margin-top: .4rem; }
.arquivo-meta span { display: inline-flex; align-items: center; gap: .2rem; padding: .12rem .4rem; border-radius: 999px; background: var(--bg-tertiary); border: 1px solid var(--border); }
.arquivo-actions { display: flex; gap: .4rem; flex-shrink: 0; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-light); }
.empty-state .empty-icon { font-size: 4rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: .5rem; }
.empty-state p { color: var(--text-light); margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .4rem; }
.form-group small { color: var(--text-light); font-weight: 400; }
.form-control {
    width: 100%; padding: .6rem .9rem; border: 1.5px solid var(--border); border-radius: 10px;
    font-size: .9rem; color: var(--text-primary); background: #fff; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.form-control:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.5rem; }

.progress-wrap { margin-top: .75rem; background: var(--bg-tertiary); border-radius: 999px; height: 8px; overflow: hidden; display: none; }
.progress-bar { height: 100%; width: 0%; background: var(--gradient-nf); border-radius: 999px; transition: width .3s ease; }
.progress-label { font-size: .8rem; color: var(--text-secondary); margin-top: .35rem; text-align: center; }

.drop-zone {
    border: 2px dashed var(--border); border-radius: 14px; padding: 2.5rem 1rem; text-align: center;
    margin-bottom: 1.25rem; background: var(--bg-secondary); transition: all 0.3s cubic-bezier(0.4,0,0.2,1); position: relative; cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(236,72,153,.04));
}
.drop-icon { font-size: 3rem; display: block; margin-bottom: .6rem; }
.drop-zone p { color: var(--text-secondary); margin-bottom: .35rem; }
.drop-label { color: #6366f1; cursor: pointer; font-weight: 700; text-decoration: underline; text-decoration-style: dotted; }
.drop-input { position: absolute; opacity: 0; width: 0; height: 0; }
.drop-hint { font-size: .78rem; color: var(--text-light); }
.file-selected {
    margin-top: 1rem; padding: .65rem 1rem;
    background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(16,185,129,.04));
    border: 1px solid rgba(16,185,129,.3); border-radius: 10px; font-size: .87rem; color: #065f46; font-weight: 500;
}

.login-body {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #701a75 100%); position: relative; overflow: hidden;
}
.login-body::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.3) 0%, transparent 60%), radial-gradient(ellipse at 80% 50%, rgba(236,72,153,.2) 0%, transparent 60%);
}
.login-card {
    position: relative; z-index: 1; background: rgba(255,255,255,.97); border-radius: 18px;
    padding: 2.75rem 2.25rem; width: 100%; max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.1);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-box {
    display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    width: 78px; height: 78px; border-radius: 20px;
    background: #000; margin-bottom: .85rem;
    box-shadow: 0 12px 36px rgba(99,102,241,.4), 0 0 0 1px rgba(251,191,36,.12), inset 0 1px 0 rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
}
.login-logo-nf { display: none; }
.login-logo-n, .login-logo-f {
    font-size: 26px; font-weight: 900; letter-spacing: -1px;
    color: #fff; line-height: 1; font-family: inherit;
}
.login-logo-bolt-inline {
    font-size: 20px; color: #fbbf24; line-height: 1;
    filter: drop-shadow(0 0 7px rgba(251,191,36,.9));
    animation: boltPulse 2s ease-in-out infinite; display: inline-block;
}
/* legacy compat */
.login-logo-bolt { display: none; }
.login-logo h1 { font-size: 1.35rem; font-weight: 800; color: #1f2937; }
.login-logo p  { color: #6b7280; font-size: .88rem; margin-top: .2rem; }
.login-logo .subtitle-accent {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700;
}

.alert { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1.1rem; font-size: .88rem; font-weight: 500; display: flex; align-items: center; gap: .5rem; }
.alert-success { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.alert-danger  { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .6rem; border-radius: 999px; font-size: .73rem; font-weight: 700; }
.badge-secondary { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-primary   { background: rgba(99,102,241,.12); color: #6366f1; }
.badge-warning   { background: #fef3c7; color: #92400e; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: #fff; border-radius: 14px; box-shadow: var(--shadow-md); padding: 1.4rem 1.25rem;
    border: 1px solid var(--border); position: relative; overflow: hidden; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%); }
.stat-icon { font-size: 1.75rem; margin-bottom: .5rem; }
.stat-value { font-size: 2rem; font-weight: 900; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-secondary); margin-top: .3rem; font-weight: 500; }

.tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--border); }
.tab { padding: .65rem 1.1rem; font-size: .9rem; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.3s cubic-bezier(0.4,0,0.2,1); }
.tab.active { color: #6366f1; border-bottom-color: #6366f1; }
.tab:hover  { color: #6366f1; text-decoration: none; }

.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th {
    text-align: left; padding: .6rem .8rem; font-weight: 700; font-size: .78rem;
    color: var(--text-light); text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 2px solid var(--border); background: var(--bg-tertiary);
}
.table td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--bg-secondary); }
.table tr:last-child td { border-bottom: none; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-light); font-size: .82rem; }

.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }
.two-col h3 { font-size: 1rem; font-weight: 800; margin-bottom: 1rem; }

.footer { text-align: center; color: var(--text-light); font-size: .78rem; padding: 2rem 0 1.5rem; border-top: 1px solid var(--border); margin-top: 2rem; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

@media (max-width: 640px) {
    .navbar { padding: 0 1rem; }
    .container { padding: 1rem .75rem; }
    .arquivo-card { flex-wrap: wrap; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .brand-sub { display: none; }
}


/* ============================================================
   v2 â?,???? Melhorias UX (cards de pasta, toolbar, modos lista/grade,
   miniaturas, tags por tipo, modal de preview, dicas amig?f¡veis)
   ============================================================ */

/* Barra r?f¡pida de busca */
.quick-bar {
    display: flex; gap: .6rem; align-items: stretch;
    background: #fff; padding: .75rem; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.quick-search { position: relative; flex: 1; display: flex; align-items: center; }
.quick-search-icon { position: absolute; left: .8rem; opacity: .55; pointer-events: none; font-size: 1rem; }
.quick-search input {
    width: 100%; padding: .7rem .85rem .7rem 2.3rem;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    font-size: .95rem; background: var(--bg-secondary); transition: var(--transition);
}
.quick-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

/* Hero de boas-vindas */
.hero-help {
    display: flex; gap: 1.1rem; align-items: center;
    background: linear-gradient(135deg, rgba(99,102,241,.07), rgba(236,72,153,.07));
    border: 1px solid rgba(99,102,241,.18); padding: 1.2rem 1.4rem;
    border-radius: var(--radius-lg); margin-bottom: 1.5rem;
}
.hero-help-icon { font-size: 2.6rem; line-height: 1; flex-shrink: 0; }
.hero-help-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 .25rem; color: var(--text-primary); }
.hero-help-sub   { color: var(--text-secondary); font-size: .92rem; margin: 0; }

.section-block { margin-bottom: 2rem; }
.section-block-header { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .85rem; flex-wrap: wrap; }
.section-block-header h3 { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin: 0; }
.section-block-sub { color: var(--text-light); font-size: .82rem; }

/* Recentes */
.recent-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.recent-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition);
    display: flex; flex-direction: column;
}
.recent-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.recent-thumb { height: 110px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-thumb-ico { font-size: 2.6rem; }
.recent-thumb-tag {
    position: absolute; top: .4rem; right: .4rem; color: #fff;
    font-size: .65rem; font-weight: 700; padding: .15rem .45rem;
    border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.recent-name { font-size: .85rem; font-weight: 600; padding: .6rem .7rem .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { font-size: .73rem; color: var(--text-light); padding: 0 .7rem .55rem; }
.recent-actions { display: flex; gap: .35rem; padding: .25rem .55rem .65rem; }
.recent-actions .btn { flex: 1; justify-content: center; }

/* Cards de pasta */
.folder-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.folder-card-big {
    --fc: var(--primary);
    --fc-bg: rgba(99,102,241,.1);
    display: grid; grid-template-columns: auto 1fr auto;
    align-items: center; gap: 1rem; padding: 1.1rem 1.2rem;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    color: var(--text-primary); text-decoration: none; transition: var(--transition);
    border-left: 4px solid var(--fc);
}
.folder-card-big:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); background: linear-gradient(135deg, var(--fc-bg), #fff); text-decoration: none; }
.folder-card-icon {
    font-size: 2.1rem; width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--fc-bg); color: var(--fc); border-radius: var(--radius-md); position: relative;
}
.folder-card-lock { position: absolute; bottom: -4px; right: -4px; font-size: .9rem; background: #fff; border-radius: 999px; padding: 1px 3px; }
.folder-card-body { min-width: 0; }
.folder-card-title { font-weight: 800; font-size: 1.02rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-card-meta { color: var(--text-secondary); font-size: .8rem; display: flex; gap: .35rem; margin-top: .15rem; }
.folder-card-foot { color: var(--text-light); font-size: .72rem; margin-top: .35rem; }
.folder-card-arrow { color: var(--fc); font-size: 1.4rem; font-weight: 700; opacity: .6; transition: var(--transition); }
.folder-card-big:hover .folder-card-arrow { opacity: 1; transform: translateX(4px); }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb-sep { color: var(--text-light); }
.breadcrumb-current { color: var(--text-primary); font-weight: 700; }

/* Layout pasta (sidebar + content) */
.layout-folder { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .layout-folder { grid-template-columns: 1fr; } }
.pasta-item-count { background: var(--bg-tertiary); color: var(--text-secondary); font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; font-weight: 700; }
.pasta-item.active .pasta-item-count { background: rgba(255,255,255,.25); color: #fff; }

/* Toolbar de arquivos */
.files-toolbar {
    display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
    padding: .65rem .8rem; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-md); margin-bottom: 1rem;
}
.files-toolbar-lbl { font-size: .82rem; color: var(--text-secondary); font-weight: 600; }
.files-sort { width: auto; max-width: 240px; padding: .45rem .7rem; font-size: .85rem; }
.view-toggle { margin-left: auto; display: flex; background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: 3px; }
.view-btn { padding: .4rem .8rem; font-size: .82rem; border: none; background: transparent; cursor: pointer; border-radius: 5px; font-weight: 600; color: var(--text-secondary); transition: var(--transition); }
.view-btn:hover { color: var(--primary); }
.view-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

/* Grade de arquivos com modos lista/grade */
.arquivo-grid.view-list { display: flex; flex-direction: column; gap: .7rem; }
.arquivo-grid.view-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.arquivo-grid.view-grid .arquivo-card { flex-direction: column; align-items: stretch; padding: 1rem; gap: .6rem; }
.arquivo-grid.view-grid .arquivo-icon { width: 100%; height: 130px; font-size: 3rem; border-radius: var(--radius-md); }
.arquivo-grid.view-grid .arquivo-info { width: 100%; }
.arquivo-grid.view-grid .arquivo-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
.arquivo-grid.view-grid .arquivo-actions .btn { flex: 1 1 auto; justify-content: center; }
.arquivo-grid.view-grid .arquivo-meta { flex-wrap: wrap; }

.arquivo-thumb-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.arquivo-tag {
    display: inline-block; font-size: .65rem; font-weight: 700;
    padding: .15rem .5rem; border-radius: 999px;
    margin-left: .4rem; vertical-align: middle; text-transform: uppercase; letter-spacing: .03em;
}
.btn-label { display: inline; }
@media (max-width: 480px) { .btn-label { display: none; } }
.btn-xs { padding: .3rem .55rem; font-size: .72rem; }

.files-help {
    margin-top: 1.25rem; padding: .8rem 1rem; background: rgba(99,102,241,.06);
    border-left: 3px solid var(--primary); border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: .85rem;
}

/* Modal de preview */
.preview-modal {
    position: fixed; inset: 0; background: rgba(15,23,42,.78);
    display: none; align-items: center; justify-content: center;
    padding: 1rem; z-index: 1000; backdrop-filter: blur(3px);
}
.preview-modal.open { display: flex; }
.preview-modal-box {
    background: #fff; width: 100%; max-width: 1000px; max-height: 92vh;
    border-radius: var(--radius-lg); display: flex; flex-direction: column;
    overflow: hidden; box-shadow: var(--shadow-xl);
}
.preview-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.2rem; border-bottom: 1px solid var(--border);
    background: var(--bg-secondary); gap: 1rem;
}
.preview-modal-head strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-modal-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.preview-modal-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background: #1f2937; min-height: 60vh; }
.preview-img { max-width: 100%; max-height: 88vh; object-fit: contain; display: block; }
.preview-iframe { width: 100%; height: 88vh; border: none; background: #fff; }
#previewLoader { color: #cbd5e1; padding: 3rem; }

/* Bot?f£o outline-dark */
.btn-outline-dark { background: #fff; color: var(--text-primary); border: 1px solid var(--border); }
.btn-outline-dark:hover { background: var(--bg-tertiary); border-color: var(--text-light); text-decoration: none; }

/* Barra de progresso (upload.php) */
.progress-bar-outer { width: 100%; height: 14px; background: var(--bg-tertiary); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.progress-bar-inner {
    height: 100%; width: 0;
    background: var(--gradient-nf);
    transition: width .25s ease;
    text-align: center; color: #fff; font-size: .68rem; line-height: 14px; font-weight: 700;
}
.upload-status { margin-top: .6rem; font-size: .85rem; color: var(--text-secondary); }
.upload-status.success { color: var(--success); font-weight: 600; }
.upload-status.error   { color: var(--danger); font-weight: 600; }

/* ============================================================
   v3 ??" Tema "Linear/Vercel" (dark navbar + teal/amber)
   Sobrescreve a paleta original sem quebrar componentes
   ============================================================ */
:root {
    /* Paleta principal ??" teal */
    --primary:        #0d9488;
    --primary-dark:   #0f766e;
    --primary-light:  #2dd4bf;
    /* Acento ??" âmbar */
    --secondary:      #f59e0b;
    --secondary-light:#fbbf24;
    /* Apoio */
    --success:  #10b981;
    --warning:  #f59e0b;
    --danger:   #e11d48;
    --info:     #0ea5e9;
    /* Texto */
    --text-primary:   #0a0a0a;
    --text-secondary: #525252;
    --text-light:     #a3a3a3;
    /* Superfícies */
    --bg-primary:     #ffffff;
    --bg-secondary:   #fafafa;
    --bg-tertiary:    #f5f5f5;
    --border:         #e5e5e5;
    /* Sombras mais sutis (estilo Vercel) */
    --shadow-sm:  0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 2px 8px -1px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
    --shadow-lg:  0 8px 24px -4px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
    --shadow-xl:  0 20px 40px -8px rgba(0,0,0,.12);
    /* Gradiente assinatura ??" preto profundo com brilho teal */
    --gradient-nf: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%);
    --gradient-dark: linear-gradient(180deg, #0a0a0a 0%, #171717 100%);
}

/* Tipografia mais "Inter-like" */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Navbar escura com brilho teal */
.navbar {
    background: var(--gradient-dark) !important;
    border-bottom: 1px solid #262626;
    box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, var(--shadow-md);
    color: #fafafa;
}
.navbar-brand { color: #fafafa; }
.brand-name { color: #fafafa; font-weight: 700; letter-spacing: -.01em; }
.brand-sub { color: #a3a3a3; font-size: .72rem; font-weight: 500; }
.navbar-user span { color: #d4d4d4; font-size: .85rem; }
.navbar-user .btn-link { color: var(--primary-light); }
.navbar-user .btn-link:hover { color: #5eead4; }

/* Logo box mais discreto */
.logo-box-bg {
    background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 100%) !important;
    border: 1px solid rgba(45,212,191,.3) !important;
    box-shadow: 0 0 24px rgba(13,148,136,.4), inset 0 1px 0 rgba(255,255,255,.15) !important;
}
.logo-bolt-inline { color: #fbbf24 !important; }

/* Botões revistos ??" bordas finas, sem gradiente exagerado */
.btn {
    font-weight: 600; letter-spacing: -.005em;
    border-radius: 8px; transition: all .15s ease;
}
.btn-primary {
    background: var(--text-primary) !important;
    color: #fff !important;
    border: 1px solid var(--text-primary) !important;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: #262626 !important;
    border-color: #262626 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-outline {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    color: #fafafa !important;
}
.btn-outline:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; }

.btn-outline-dark {
    background: #fff !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}
.btn-outline-dark:hover {
    background: var(--bg-tertiary) !important;
    border-color: #d4d4d4 !important;
}
.btn-danger {
    background: #fff !important; color: var(--danger) !important;
    border: 1px solid #fecdd3 !important;
}
.btn-danger:hover { background: #fff1f2 !important; border-color: var(--danger) !important; }

/* Card / containers ??" borda sutil */
.card, .stat-card, .recent-card, .files-toolbar, .quick-bar {
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
}
.card:hover { box-shadow: var(--shadow-md) !important; }

/* Hero help ??" agora preto suave com texto claro */
.hero-help {
    background: var(--gradient-dark) !important;
    border: 1px solid #262626 !important;
    color: #fafafa;
    border-radius: 14px !important;
    padding: 1.5rem 1.75rem !important;
    position: relative;
    overflow: hidden;
}
.hero-help::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 90% 50%, rgba(13,148,136,.25), transparent 60%);
    pointer-events: none;
}
.hero-help-icon { color: var(--primary-light); }
.hero-help-title { color: #fafafa !important; font-weight: 700; letter-spacing: -.015em; }
.hero-help-sub { color: #a3a3a3 !important; }
.hero-help-sub strong { color: var(--primary-light); font-weight: 600; }

/* Section block headers */
.section-block-header h3 {
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--text-primary);
}
.section-block-sub { color: var(--text-light); font-size: .8rem; }

/* Folder cards ??" visual mais "flat/Vercel" */
.folder-card-big {
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    border-left: 3px solid var(--fc) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 1.2rem 1.3rem !important;
    transition: all .18s ease !important;
}
.folder-card-big:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-lg) !important;
    background: #fff !important;
    border-color: var(--fc) !important;
}
.folder-card-icon {
    border-radius: 10px !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.folder-card-title { letter-spacing: -.01em; }

/* Recent cards */
.recent-card {
    border-radius: 12px !important;
    transition: all .18s ease !important;
}
.recent-card:hover {
    transform: translateY(-2px) !important;
    border-color: var(--primary) !important;
}
.recent-thumb-tag { font-weight: 600; letter-spacing: 0; text-transform: none; }

/* Arquivo cards (lista/grade) */
.arquivo-card {
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    transition: all .15s ease !important;
}
.arquivo-card:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(13,148,136,.08) !important;
}
.arquivo-tag { font-weight: 600; text-transform: none; letter-spacing: 0; }

/* Tabs do admin */
.tab.active { color: var(--primary) !important; border-bottom-color: var(--primary) !important; }
.tab:hover  { color: var(--primary) !important; }

/* Inputs */
.form-control, .quick-search input, .files-sort {
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    transition: all .15s ease;
}
.form-control:focus, .quick-search input:focus, .files-sort:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(13,148,136,.12) !important;
}

/* Sidebar pasta */
.sidebar { background: #fff; border-radius: 12px; padding: 1rem; border: 1px solid var(--border); }
.pasta-item:hover { background: var(--bg-tertiary); }
.pasta-item.active {
    background: var(--text-primary) !important;
    color: #fff !important;
}

/* Dica/info */
.files-help {
    background: #f0fdfa !important;
    border-left: 3px solid var(--primary) !important;
    color: #134e4a !important;
}

/* View toggle */
.view-btn.active { color: var(--primary) !important; }
.view-btn:hover { color: var(--primary) !important; }

/* Badges */
.badge-primary {
    background: rgba(13,148,136,.1) !important;
    color: var(--primary-dark) !important;
    border: 1px solid rgba(13,148,136,.2);
}

/* Alerts mais limpos */
.alert {
    border-radius: 10px !important;
    border: 1px solid;
    padding: .9rem 1.1rem;
}
.alert-success { background: #f0fdf4 !important; border-color: #bbf7d0 !important; color: #14532d !important; }
.alert-danger  { background: #fef2f2 !important; border-color: #fecaca !important; color: #7f1d1d !important; }
.alert-warning { background: #fffbeb !important; border-color: #fde68a !important; color: #78350f !important; }
.alert-info    { background: #eff6ff !important; border-color: #bfdbfe !important; color: #1e3a8a !important; }

/* Footer */
.footer { color: var(--text-light); font-size: .78rem; }

/* Drop zone (upload) */
.drop-zone {
    border: 2px dashed #d4d4d4 !important;
    border-radius: 14px !important;
    background: var(--bg-secondary);
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary) !important;
    background: #f0fdfa;
}
.drop-label { color: var(--primary) !important; font-weight: 600; }

/* Progress bar ??" agora preta */
.progress-bar-inner { background: var(--text-primary) !important; }

/* Scrollbar discreta */
::-webkit-scrollbar-thumb { background: #d4d4d4; }
::-webkit-scrollbar-thumb:hover { background: #a3a3a3; }
/* ============================================================
   v4 ??" Cards de pasta padronizados (paleta unificada)
   ============================================================ */

.folder-cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 1.1rem !important;
}

.folder-card-big {
    --fc: #0d9488;
    --fc-light: #5eead4;
    --fc-bg: #f0fdfa;

    position: relative;
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center;
    gap: 1rem !important;
    padding: 1.15rem 1.25rem !important;

    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-left: none !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 0 rgba(255,255,255,.6) inset !important;

    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
}

.folder-card-big::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--fc), var(--fc-light));
    border-radius: 14px 0 0 14px;
}

.folder-card-big::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 100% 0%, var(--fc-bg), transparent 55%);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    z-index: -1;
}

.folder-card-big:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 28px -10px rgba(0,0,0,.15), 0 4px 12px rgba(0,0,0,.06) !important;
    border-color: var(--fc) !important;
    text-decoration: none !important;
}
.folder-card-big:hover::after { opacity: 1; }
.folder-card-big:hover .folder-card-arrow { transform: translateX(4px); color: var(--fc); }

.folder-card-icon {
    width: 56px !important;
    height: 56px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, var(--fc) 0%, var(--fc-light) 100%) !important;
    color: #fff !important;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem !important;
    position: relative;
    flex-shrink: 0;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.25),
        inset 0 -1px 0 rgba(0,0,0,.08),
        0 4px 10px -2px var(--fc-bg);
}
.folder-card-icon-letter {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -.02em;
    text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.folder-card-lock {
    position: absolute;
    bottom: -5px; right: -5px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 4px;
    font-size: .75rem;
    box-shadow: var(--shadow-sm);
}

.folder-card-body { min-width: 0; }
.folder-card-title-row {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: .35rem;
}
.folder-card-title {
    font-weight: 700 !important;
    font-size: 1.02rem !important;
    color: var(--text-primary) !important;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.folder-card-badge {
    font-size: .62rem;
    font-weight: 700;
    background: var(--fc);
    color: #fff;
    padding: .12rem .45rem;
    border-radius: 999px;
    letter-spacing: .04em;
    flex-shrink: 0;
}

.folder-card-meta {
    display: flex !important;
    flex-wrap: wrap;
    gap: .35rem !important;
    margin: 0 !important;
}
.meta-pill {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: .73rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-weight: 500;
    line-height: 1.4;
}
.meta-pill strong {
    color: var(--text-primary);
    font-weight: 700;
}

.folder-card-foot {
    display: flex !important;
    align-items: center;
    gap: .4rem;
    color: var(--text-light) !important;
    font-size: .73rem !important;
    margin-top: .55rem !important;
}
.foot-dot {
    width: 6px; height: 6px;
    border-radius: 999px;
    background: var(--fc);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--fc-bg);
}
.folder-card-foot-empty {
    color: var(--text-light) !important;
    font-style: italic;
}
.folder-card-foot-empty .foot-dot {
    background: #d4d4d4;
    box-shadow: 0 0 0 3px #f5f5f5;
}

.folder-card-arrow {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-light) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    flex-shrink: 0;
}
.folder-card-big:hover .folder-card-arrow {
    background: var(--fc-bg);
}

@media (max-width: 640px) {
    .folder-cards { grid-template-columns: 1fr !important; gap: .75rem !important; }
    .folder-card-icon { width: 48px !important; height: 48px !important; }
    .folder-card-icon-letter { font-size: 1.25rem; }
}

/* ============================================================
   v4.1 - Corre??o de tipografia (carrega Inter + ajusta tracking)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Tracking suave (sem apertar) */
.brand-name, .hero-help-title, .folder-card-title, .recent-name,
.section-block-header h3, h1, h2, h3 {
    letter-spacing: -.005em !important;
}

/* Avatar da pasta - sem sombra que borra a letra */
.folder-card-icon-letter {
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
}

/* Bot?es */
.btn { letter-spacing: 0 !important; }
/* ============================================================
   v4.1 - Corre??o de tipografia (carrega Inter + ajusta tracking)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Tracking suave (sem apertar) */
.brand-name, .hero-help-title, .folder-card-title, .recent-name,
.section-block-header h3, h1, h2, h3 {
    letter-spacing: -.005em !important;
}

/* Avatar da pasta - sem sombra que borra a letra */
.folder-card-icon-letter {
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
}

/* Bot?es */
.btn { letter-spacing: 0 !important; }