/* ========================================
   DESTINO ESPANHA — Portal CSS
   Styles for Client Portal + Admin Panel
   Inherits from main style.css design system
   ======================================== */

/* === Import Base Design Tokens === */
:root {
    --primary: #0a0f1a;
    --primary-light: #141c2e;
    --primary-mid: #1a2744;
    --gold: #d4a853;
    --gold-light: #f0d68a;
    --gold-dark: #b8912e;
    --accent-blue: #4a7cff;
    --accent-teal: #2dd4bf;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --accent-orange: #f59e0b;
    --text-main: #1a1a2e;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-section: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-bg-light: rgba(255, 255, 255, 0.7);
    --glass-border-light: rgba(255, 255, 255, 0.9);
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 40px rgba(212, 168, 83, 0.3);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 100px;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --sidebar-width: 280px;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background: var(--bg-section);
    line-height: 1.7;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { font-family: var(--font-serif); line-height: 1.2; color: var(--primary); }

/* ==============================
   LOGIN PAGE
   ============================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212,168,83,0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(74,124,255,0.08) 0%, transparent 50%);
}
.login-card {
    position: relative;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 50px 45px;
    width: 100%;
    max-width: 440px;
    margin: 20px;
}
.login-logo {
    text-align: center;
    margin-bottom: 40px;
}
.login-logo .logo-text {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}
.login-logo .logo-text span { color: var(--gold); }
.login-logo .logo-sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 8px;
}
.login-title {
    color: #fff;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 30px;
}

/* Form Inputs */
.form-group {
    margin-bottom: 20px;
    position: relative;
}
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}
.form-group input::placeholder { color: rgba(255,255,255,0.3); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,168,83,0.15);
    background: rgba(255,255,255,0.1);
}
.form-group select option { background: var(--primary); color: #fff; }

/* Light theme form inputs (for admin/client portals) */
.portal-content .form-group label {
    color: var(--text-light);
}
.portal-content .form-group input,
.portal-content .form-group select,
.portal-content .form-group textarea {
    background: var(--bg-white);
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--text-main);
}
.portal-content .form-group input::placeholder { color: var(--text-muted); }
.portal-content .form-group input:focus,
.portal-content .form-group select:focus,
.portal-content .form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,168,83,0.1);
}

/* Login button */
.btn-login {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212,168,83,0.4);
}
.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-login .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(10,15,26,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}
.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-forgot {
    text-align: center;
    margin-top: 16px;
}
.login-forgot a {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    transition: var(--transition);
}
.login-forgot a:hover { color: var(--gold); }

.login-back {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.login-back a {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.login-back a:hover { color: var(--gold-light); }

/* Alert messages */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}
.alert.show { display: block; }
.alert-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}
.alert-success {
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.25);
    color: #86efac;
}
/* Light theme alerts */
.portal-content .alert-error {
    background: rgba(239,68,68,0.08);
    color: var(--accent-red);
}
.portal-content .alert-success {
    background: rgba(34,197,94,0.08);
    color: #16a34a;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================
   PORTAL LAYOUT (Sidebar + Content)
   ============================== */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}
.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-logo span { color: var(--gold); }
.sidebar-role {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-role::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}
.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.3);
    padding: 16px 24px 8px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}
.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}
.sidebar-link.active {
    color: var(--gold-light);
    background: rgba(212,168,83,0.08);
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}
.sidebar-link .link-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.sidebar-link .link-badge {
    margin-left: auto;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}
.sidebar-user-info {
    flex: 1;
    min-width: 0;
}
.sidebar-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-email {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-logout {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-logout:hover {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}

/* Mobile sidebar toggle */
.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: var(--primary);
    border: 1px solid rgba(212,168,83,0.3);
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* --- Main Content --- */
.portal-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}
.portal-header {
    background: var(--bg-white);
    padding: 24px 40px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.portal-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}
.portal-header .header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.portal-body {
    padding: 32px 40px;
}

/* ==============================
   DASHBOARD COMPONENTS
   ============================== */

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.metric-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.metric-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
}
.metric-card.gold::after { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }
.metric-card.blue::after { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.metric-card.green::after { background: linear-gradient(90deg, #16a34a, var(--accent-green)); }
.metric-card.orange::after { background: linear-gradient(90deg, #d97706, var(--accent-orange)); }
.metric-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}
.metric-value {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.metric-label {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Data Table */
.data-table-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
}
.data-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.data-table-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}
.data-table-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}
.filter-select {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--bg-white);
    font-size: 0.82rem;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    font-family: var(--font-sans);
}
.filter-select:focus { border-color: var(--gold); }

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 14px 24px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-family: var(--font-sans);
}
.data-table td {
    padding: 16px 24px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    vertical-align: middle;
}
.data-table tr { transition: var(--transition); }
.data-table tbody tr:hover { background: rgba(212,168,83,0.03); }
.data-table tbody tr { cursor: pointer; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-lead { background: rgba(156,163,175,0.12); color: #6b7280; }
.status-lead::before { background: #6b7280; }
.status-diagnostico { background: rgba(74,124,255,0.1); color: var(--accent-blue); }
.status-diagnostico::before { background: var(--accent-blue); }
.status-documentacao { background: rgba(245,158,11,0.1); color: #d97706; }
.status-documentacao::before { background: #d97706; }
.status-visto { background: rgba(212,168,83,0.12); color: var(--gold-dark); }
.status-visto::before { background: var(--gold-dark); }
.status-aterragem { background: rgba(45,212,191,0.1); color: #0d9488; }
.status-aterragem::before { background: #0d9488; }
.status-concluido { background: rgba(34,197,94,0.1); color: #16a34a; }
.status-concluido::before { background: #16a34a; }

/* Document status */
.doc-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}
.doc-status.pendente { color: var(--text-muted); }
.doc-status.enviado { color: var(--accent-orange); }
.doc-status.aprovado { color: var(--accent-green); }
.doc-status.revisar { color: var(--accent-red); }

/* ==============================
   CLIENT PORTAL COMPONENTS
   ============================== */

/* Progress Bar */
.progress-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 32px;
    border: 1px solid rgba(0,0,0,0.04);
    margin-bottom: 28px;
}
.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.progress-header h3 { font-size: 1.1rem; }
.progress-percentage {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
}
.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-section);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 20px;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
    border-radius: var(--radius-full);
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
}
.progress-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-section);
    border: 2px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 2;
}
.progress-step.completed .progress-step-dot {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
}
.progress-step.active .progress-step-dot {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(212,168,83,0.2);
}
.progress-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}
.progress-step.completed .progress-step-label { color: var(--accent-green); }
.progress-step.active .progress-step-label { color: var(--gold-dark); }

/* Info Cards Grid */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.info-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
}
.info-card:hover {
    box-shadow: var(--shadow-sm);
}
.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.info-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.info-card-icon.docs { background: rgba(74,124,255,0.1); }
.info-card-icon.date { background: rgba(212,168,83,0.1); }
.info-card-icon.msg { background: rgba(34,197,94,0.1); }
.info-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
}
.info-card-value {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

/* Timeline */
.timeline {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 28px;
    border: 1px solid rgba(0,0,0,0.04);
}
.timeline h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}
.timeline-list { list-style: none; }
.timeline-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    position: relative;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    margin-top: 6px;
    flex-shrink: 0;
}
.timeline-text {
    font-size: 0.9rem;
    color: var(--text-main);
}
.timeline-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==============================
   DOCUMENT LIST
   ============================== */
.doc-list {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.04);
    overflow: hidden;
}
.doc-list-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.doc-list-header h3 { font-size: 1.1rem; }
.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
}
.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: rgba(212,168,83,0.02); }
.doc-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--bg-section);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.doc-info { flex: 1; min-width: 0; }
.doc-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.doc-category {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.doc-comment {
    font-size: 0.8rem;
    color: var(--accent-red);
    margin-top: 4px;
    font-style: italic;
}
.doc-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==============================
   BUTTONS (Portal)
   ============================== */
.btn-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}
.btn-portal:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--primary);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(212,168,83,0.3); transform: translateY(-1px); }
.btn-secondary {
    background: var(--bg-section);
    color: var(--text-main);
    border: 1px solid rgba(0,0,0,0.08);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-dark); }
.btn-danger {
    background: rgba(239,68,68,0.1);
    color: var(--accent-red);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }
.btn-small { padding: 6px 14px; font-size: 0.78rem; }
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-section);
    border: 1px solid rgba(0,0,0,0.06);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
}
.btn-icon:hover { border-color: var(--gold); color: var(--gold); }

/* File upload */
.upload-zone {
    border: 2px dashed rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-light);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--gold);
    background: rgba(212,168,83,0.04);
}
.upload-zone-icon { font-size: 2rem; margin-bottom: 10px; }
.upload-zone-text { font-size: 0.9rem; color: var(--text-light); }
.upload-zone-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.upload-zone input[type="file"] { display: none; }

/* ==============================
   MODAL
   ============================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 36px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-header h3 { font-size: 1.3rem; }
.modal-close {
    width: 36px; height: 36px;
    border: none; background: var(--bg-section);
    border-radius: 50%; cursor: pointer;
    font-size: 1.1rem; color: var(--text-light);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--accent-red); color: #fff; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* Light theme form inputs inside modals (modals sit outside .portal-content) */
.modal .form-group label {
    color: var(--text-light);
}
.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    background: var(--bg-white);
    border: 1px solid rgba(0,0,0,0.12);
    color: var(--text-main);
}
.modal .form-group input::placeholder,
.modal .form-group textarea::placeholder {
    color: var(--text-muted);
}
.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,168,83,0.1);
    background: var(--bg-white);
}
.modal .form-group select option {
    background: var(--bg-white);
    color: var(--text-main);
}
/* Light theme alerts inside modals */
.modal .alert-error {
    background: rgba(239,68,68,0.08);
    color: var(--accent-red);
}
.modal .alert-success {
    background: rgba(34,197,94,0.08);
    color: #16a34a;
}

/* ==============================
   EMPTY STATE
   ============================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state-text { font-size: 1rem; margin-bottom: 8px; }
.empty-state-sub { font-size: 0.85rem; }

/* ==============================
   LOADING SKELETON
   ============================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-section) 25%, rgba(0,0,0,0.04) 50%, var(--bg-section) 75%);
    background-size: 200% 100%;
    animation: shimmerSkeleton 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmerSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-card {
    height: 120px;
    border-radius: var(--radius-md);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1024px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-body { padding: 24px; }
    .portal-header { padding: 20px 24px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-mobile-toggle {
        display: flex;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .portal-content {
        margin-left: 0;
    }
    .portal-header {
        padding: 16px 20px;
        padding-left: 70px;
    }
    .portal-header h1 { font-size: 1.2rem; }
    .portal-body { padding: 16px; }
    .metrics-grid { grid-template-columns: 1fr; }
    .progress-steps { flex-wrap: wrap; gap: 8px; }
    .info-cards { grid-template-columns: 1fr; }
    .data-table-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .data-table-filters { width: 100%; flex-wrap: wrap; }
    .doc-item { flex-wrap: wrap; }
    .doc-actions { width: 100%; justify-content: flex-end; }
    .modal { padding: 24px; margin: 10px; }
    .login-card { padding: 36px 28px; }
}

@media (max-width: 480px) {
    .login-card { padding: 30px 20px; }
    .progress-step-label { font-size: 0.65rem; }
}

/* ==============================
   SERVICES SHOWCASE (Client Portal)
   ============================== */

/* Current Plan Banner */
.svc-current-plan-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-mid));
    border-radius: var(--radius-md);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
.svc-current-plan-banner::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 200px; height: 100%;
    background: radial-gradient(circle at right, rgba(212,168,83,0.15), transparent 70%);
}
.svc-current-plan-info {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}
.svc-current-plan-icon {
    width: 48px; height: 48px;
    background: rgba(212,168,83,0.15);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.svc-current-plan-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold-light);
}
.svc-current-plan-name {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
}
.svc-current-plan-value {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gold-light);
    position: relative;
    z-index: 1;
}

/* Section Title */
.svc-section-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

/* Plans Grid */
.svc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Plan Card */
.svc-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 28px;
    border: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.svc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.svc-card.is-current {
    border: 2px solid var(--gold);
    box-shadow: 0 0 0 3px rgba(212,168,83,0.1);
}
.svc-card.is-popular {
    border: 2px solid var(--gold);
}
.svc-card.is-premium {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
    color: #fff;
}
.svc-card.is-premium .svc-card-name,
.svc-card.is-premium .svc-card-desc,
.svc-card.is-premium .svc-card-feature {
    color: rgba(255,255,255,0.85);
}
.svc-card.is-premium .svc-card-price-value {
    color: var(--gold-light);
}

/* Card Badge */
.svc-card-badge {
    position: absolute;
    top: 16px; right: 16px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.svc-badge-current {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
}
.svc-badge-popular {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--primary);
}

/* Card Content */
.svc-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}
.svc-card-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.svc-card-price {
    margin-bottom: 12px;
}
.svc-card-price-from {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.svc-card-price-value {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold-dark);
}
.svc-card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 16px;
}
.svc-card-features {
    list-style: none;
    margin-bottom: 20px;
    flex: 1;
}
.svc-card-feature {
    font-size: 0.82rem;
    color: var(--text-main);
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.svc-card-feature::before {
    content: '✓';
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.75rem;
}
.svc-card .btn-portal {
    width: 100%;
    margin-top: auto;
}

/* Avulsos Grid */
.svc-avulsos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.svc-avulso-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.06);
    transition: var(--transition);
}
.svc-avulso-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--gold);
}
.svc-avulso-icon {
    font-size: 1.6rem;
    margin-bottom: 10px;
}
.svc-avulso-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 6px;
}
.svc-avulso-desc {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 14px;
}
.svc-avulso-price {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--gold-dark);
    margin-bottom: 12px;
}
.svc-avulso-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gold-dark);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.svc-avulso-link:hover { color: var(--gold); }

/* Purchase Summary (in modal) */
.svc-purchase-summary {
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}
.svc-purchase-plan-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.svc-purchase-plan-price {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold-dark);
    margin-bottom: 8px;
}
.svc-purchase-plan-features {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.6;
}
.svc-purchase-upgrade-note {
    background: rgba(212,168,83,0.08);
    border: 1px solid rgba(212,168,83,0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--gold-dark);
    margin-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .svc-grid { grid-template-columns: 1fr; }
    .svc-avulsos-grid { grid-template-columns: 1fr; }
    .svc-current-plan-banner { flex-direction: column; gap: 16px; text-align: center; }
    .svc-current-plan-info { flex-direction: column; }
}
