/* ============================================
   PORTAL TÉCNICO — DESIGN SYSTEM
   ============================================ */

:root {
    /* Paleta — industrial / profissional */
    --color-bg:           #f5f7fa;
    --color-surface:      #ffffff;
    --color-surface-alt:  #f8fafc;
    --color-border:       #e2e8f0;
    --color-border-dark:  #cbd5e1;

    --color-primary:      #0f172a;
    --color-primary-soft: #1e293b;
    --color-secondary:    #334155;

    --color-accent:       #2563eb;
    --color-accent-dark:  #1d4ed8;
    --color-accent-soft:  #dbeafe;

    --color-success:      #059669;
    --color-success-soft: #d1fae5;
    --color-warning:      #d97706;
    --color-warning-soft: #fef3c7;
    --color-danger:       #dc2626;
    --color-danger-soft:  #fee2e2;

    --color-text:         #0f172a;
    --color-text-muted:   #64748b;
    --color-text-light:   #94a3b8;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow:    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.14);

    --transition:      all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-width: 260px;
    --header-height: 64px;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    color: var(--color-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; color: var(--color-secondary); }

a { color: var(--color-accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-accent-dark); }

hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

small { font-size: 0.85em; color: var(--color-text-muted); }

img { max-width: 100%; }

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #cbd5e1;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
}
.sidebar.is-open { transform: translateX(0); }

.sidebar-brand {
    padding: 22px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: var(--color-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.sidebar-brand-sub {
    font-size: 0.68rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-user {
    padding: 12px 14px;
    margin: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 0.68rem;
    color: var(--color-success);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sidebar-section-label {
    padding: 18px 22px 8px;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    font-weight: 600;
}

.sidebar-nav { flex: 1; padding-bottom: 20px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 22px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
    text-decoration: none;
}
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border-left-color: var(--color-accent);
}
.sidebar-nav a.is-active {
    background: rgba(37, 99, 235, 0.12);
    color: #fff;
    border-left-color: var(--color-accent);
}
.sidebar-nav-icon {
    width: 18px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.85;
}
.sidebar-nav a.logout {
    color: #fca5a5;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 14px;
    padding-top: 14px;
}
.sidebar-nav a.logout:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #fff;
    border-left-color: var(--color-danger);
}

/* ============ TOPBAR ============ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}
.topbar-toggle {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}
.topbar-toggle:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-border-dark);
}
.topbar-title {
    margin-left: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: -0.01em;
}
.topbar-spacer { flex: 1; }

/* ============ OVERLAY ============ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 950;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.sidebar-overlay.is-visible { opacity: 1; visibility: visible; }

/* ============ MAIN CONTENT ============ */
#main-content {
    margin-left: 0;
    padding: calc(var(--header-height) + 28px) 28px 60px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .sidebar { transform: translateX(0); }
    #main-content { margin-left: var(--sidebar-width); }
    .topbar { left: var(--sidebar-width); }
    .topbar-toggle { display: none; }
    .sidebar-overlay { display: none !important; }
}

@media (max-width: 600px) {
    #main-content { padding: calc(var(--header-height) + 18px) 16px 40px; }
    .topbar { padding: 0 16px; }
}

.container    { max-width: 1280px; margin: 0 auto; width: 100%; }
.container-sm { max-width: 540px;  margin: 0 auto; }
.container-md { max-width: 720px;  margin: 0 auto; }
.container-lg { max-width: 960px;  margin: 0 auto; }

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.page-header-content { flex: 1; min-width: 240px; }
.page-header h1 { font-size: 1.65rem; margin-bottom: 4px; }
.page-header p { color: var(--color-text-muted); margin: 0; font-size: 0.95rem; }
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 14px;
    transition: var(--transition);
}
.back-link:hover { color: var(--color-primary); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { background: var(--color-primary-soft); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-dark); }

.btn-success { background: var(--color-success); }
.btn-success:hover { background: #047857; }

.btn-warning { background: var(--color-warning); }
.btn-warning:hover { background: #b45309; }

.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-border-dark);
}
.btn-outline:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-alt); color: var(--color-primary); }

.btn-sm  { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg  { padding: 12px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

/* ============ CARDS ============ */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}
.card-body { padding: 22px; }
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}
.card-header h2, .card-header h3 { margin: 0; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}

/* ============ FORMS ============ */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.92rem;
    transition: var(--transition);
    line-height: 1.4;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input:disabled, .form-control:disabled {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.form-help { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ============ ALERTS / BADGES ============ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 16px;
}
.alert-success { background: var(--color-success-soft); color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: var(--color-warning-soft); color: #92400e; border-color: #fde68a; }
.alert-danger  { background: var(--color-danger-soft);  color: #991b1b; border-color: #fecaca; }
.alert-info    { background: var(--color-accent-soft);  color: #1e40af; border-color: #bfdbfe; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--color-surface-alt);
    color: var(--color-secondary);
    border: 1px solid var(--color-border);
}
.badge-success { background: var(--color-success-soft); color: #065f46; border-color: #a7f3d0; }
.badge-warning { background: var(--color-warning-soft); color: #92400e; border-color: #fde68a; }
.badge-danger  { background: var(--color-danger-soft);  color: #991b1b; border-color: #fecaca; }
.badge-info    { background: var(--color-accent-soft);  color: #1e40af; border-color: #bfdbfe; }

/* ============ TABLES ============ */
.table-wrapper {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table thead th {
    background: var(--color-surface-alt);
    color: var(--color-primary);
    text-align: left;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}

.table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-secondary);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--color-surface-alt); }

/* ============ HERO CARDS (Index) ============ */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.hero-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-slow);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
}

.hero-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.hero-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(15, 23, 42, 0.4) 100%);
}
.hero-card-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.hero-card-body h2 { font-size: 1.3rem; margin-bottom: 6px; }
.hero-card-body p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    margin-bottom: 18px;
    flex: 1;
}

/* ============ BRAND GRID ============ */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
    margin-top: 8px;
}

.brand-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 14px;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 160px;
}

.brand-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.brand-logo-container {
    width: 90px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.brand-card:hover .brand-logo-container { transform: scale(1.05); }

.brand-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.brand-logo-placeholder {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 600px) {
    .brand-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 12px; }
    .brand-card { min-height: 140px; padding: 16px 10px; }
    .brand-logo-container { width: 70px; height: 56px; }
}

/* ============ MODEL GRID (Veículos) ============ */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.model-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.model-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
}

.model-card-image {
    height: 200px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}

.model-card-image img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    transition: var(--transition-slow);
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.08));
}
.model-card:hover .model-card-image img { transform: scale(1.06); }

.model-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.model-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0;
}

.model-card-years {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    margin-top: 2px;
    font-weight: 500;
}

.model-edit-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}
.model-edit-btn:hover {
    background: var(--color-accent);
    color: #fff;
    transform: scale(1.1);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    background: var(--color-surface);
    border: 2px dashed var(--color-border-dark);
    border-radius: var(--radius-lg);
}
.empty-state-icon {
    font-size: 3rem;
    color: var(--color-text-light);
    margin-bottom: 14px;
}
.empty-state h3 { color: var(--color-secondary); }
.empty-state p { color: var(--color-text-muted); }

/* ============ AUTH (Login) ============ */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.2) 0%, transparent 45%);
}
.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 40px 36px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand-icon {
    width: 56px;
    height: 56px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}
.auth-brand h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-brand p { color: var(--color-text-muted); font-size: 0.92rem; margin: 0; }

/* ============ FOOTER ============ */
.app-footer {
    text-align: center;
    padding: 24px;
    color: var(--color-text-light);
    font-size: 0.82rem;
    border-top: 1px solid var(--color-border);
    margin-top: 40px;
}

/* ============ DOC VIEWER ============ */
.viewer-frame {
    background: #1e293b;
    padding: 12px;
    border-radius: var(--radius-lg);
    min-height: 80vh;
    border: 1px solid var(--color-border);
}
.viewer-frame iframe {
    width: 100%;
    height: 800px;
    border: 0;
    border-radius: var(--radius-sm);
    background: #fff;
}

/* ============ TIP CARD ============ */
.tip-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid var(--color-warning);
    padding: 16px;
    border-radius: var(--radius);
}
.tip-card h4 {
    color: #92400e;
    font-size: 0.88rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tip-card p { color: #78350f; font-size: 0.85rem; margin: 0; }

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

@media print {
    .sidebar, .topbar, .topbar-toggle, .sidebar-overlay { display: none !important; }
    #main-content { margin-left: 0 !important; padding-top: 0 !important; }
}

/* ============================================
   v3 — RANKING, MODERAÇÃO E STATUS
   ============================================ */

/* Badge na sidebar (manuais pendentes) */
.sidebar-badge {
    margin-left: auto;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.4;
    min-width: 22px;
    text-align: center;
}

/* Status de manual */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid;
}
.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.status-pendente  { background: var(--color-warning-soft); color: #92400e; border-color: #fde68a; }
.status-pendente::before  { background: var(--color-warning); }
.status-aprovado  { background: var(--color-success-soft); color: #065f46; border-color: #a7f3d0; }
.status-aprovado::before  { background: var(--color-success); }
.status-rejeitado { background: var(--color-danger-soft);  color: #991b1b; border-color: #fecaca; }
.status-rejeitado::before { background: var(--color-danger);  }

/* Cards de estatísticas (dashboard / ranking) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 6px;
}
.stat-card-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.stat-card-sub {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}
.stat-card-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.stat-card-icon.success { background: var(--color-success-soft); color: var(--color-success); }
.stat-card-icon.warning { background: var(--color-warning-soft); color: var(--color-warning); }
.stat-card-icon.purple  { background: #ede9fe; color: #7c3aed; }

/* Progresso até próximo nível */
.progress-track {
    height: 8px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark));
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* Banner de aviso — moderação */
.moderation-banner {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.moderation-banner-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #fff;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.moderation-banner h4 {
    margin: 0 0 4px;
    color: #1e3a8a;
    font-size: 1rem;
}
.moderation-banner p {
    margin: 0;
    color: #1e40af;
    font-size: 0.9rem;
}

/* Pódio do ranking */
.podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    align-items: end;
    margin-bottom: 32px;
}
.podium-spot {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 14px 18px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}
.podium-spot:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.podium-spot.first {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    padding-top: 32px;
    transform: translateY(-12px);
}
.podium-spot.second {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #94a3b8;
    padding-top: 28px;
}
.podium-spot.third {
    background: linear-gradient(180deg, #fed7aa 0%, #fdba74 100%);
    border-color: #ea580c;
    padding-top: 24px;
}
.podium-medal {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 8px;
}
.podium-avatar {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    border: 3px solid #fff;
    box-shadow: var(--shadow-md);
}
.podium-name {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-points {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}
.podium-points-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
@media (max-width: 600px) {
    .podium { grid-template-columns: 1fr; }
    .podium-spot.first { transform: none; }
}

/* Ranking lista */
.rank-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: var(--transition);
}
.rank-row:hover { border-color: var(--color-accent); box-shadow: var(--shadow-sm); }
.rank-row.is-me { background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%); border-color: var(--color-accent); }
.rank-position {
    font-weight: 800;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    text-align: center;
}
.rank-info { min-width: 0; }
.rank-name {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.rank-points {
    text-align: right;
}
.rank-points-value {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--color-accent);
    letter-spacing: -0.02em;
}
.rank-points-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Linha de itens do feed (meus envios) */
.feed-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    transition: var(--transition);
}
.feed-item:hover { box-shadow: var(--shadow-sm); }
.feed-item-title {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.feed-item-meta {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}
.feed-item-rejected {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--color-danger-soft);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #991b1b;
    border-left: 3px solid var(--color-danger);
}
@media (max-width: 600px) {
    .feed-item { grid-template-columns: 1fr; }
}
