/* 
 * Estilos del Dashboard Consolidado SSM
 * Tema dual: Claro / Oscuro
 */

/* ============ CSS VARIABLES - TEMAS ============ */
:root {
    /* Colores base - Tema Claro */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Colores de acento */
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Dimensiones */
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
}

/* Tema Oscuro */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --border-light: #1e293b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ============ RESET Y BASE ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ============ LAYOUT ============ */
.app-container {
    display: flex;
    min-height: 100vh;
}

.topnav-layout {
    display: block;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-primary);
    color: white;
}

.nav-link-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

/* Tables: allow horizontal scroll on small screens */
.data-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topnav-layout .main-content {
    margin-left: 0;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-header {
    gap: 0.75rem;
    background: #f2f6f9;
    border-bottom: 1px solid #cad6df;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.top-header-left {
    gap: 0.9rem;
}

.top-menu-toggle {
    display: none !important;
}

.top-header-collapsible {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.top-brand {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    padding: 0.28rem 0.62rem 0.28rem 0.3rem;
    border-radius: 999px;
    border: 1px solid #c5d3dd;
    background: #eaf0f4;
    min-width: 0;
    max-width: 260px;
}

.top-brand:hover {
    background: #e0e8ee;
}

.top-brand-media {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid #bed0dc;
    background: #f8fbfd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    overflow: hidden;
}

.top-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.14rem;
}

.top-brand-mark {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #f2f6f8;
    background: #5f7f93;
    font-family: 'Manrope', 'Inter', sans-serif;
}

.top-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.1;
}

.top-brand-kicker {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7891a1;
    white-space: nowrap;
}

.top-brand-text {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #3e5b6f;
    font-family: 'Manrope', 'Inter', sans-serif;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.top-nav-dropdowns {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.top-header-right {
    gap: 0.65rem;
}

.top-dropdown {
    position: relative;
}

.top-dropdown-toggle {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #476376;
    padding: 0.38rem 0.62rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid #c5d3dd;
    background: #edf2f6;
}

.top-dropdown-toggle::-webkit-details-marker {
    display: none;
}

.top-dropdown-toggle::after {
    content: 'v';
    font-size: 0.65rem;
    opacity: 0.9;
    transition: transform 160ms ease;
}

.top-dropdown[open] .top-dropdown-toggle::after {
    transform: rotate(180deg);
}

.top-dropdown-icon {
    width: 14px;
    height: 14px;
    opacity: 0.95;
}

.top-dropdown[open] .top-dropdown-toggle,
.top-dropdown-toggle:hover {
    background: #dfe8ee;
    color: #334d5f;
}

.top-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: 220px;
    background: #f7fafc;
    border: 1px solid #c9d6df;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 14px 24px -16px rgba(20, 43, 58, 0.32);
    padding: 0.35rem;
    z-index: 110;
    transform-origin: top left;
    animation: top-dropdown-enter 170ms ease;
}

.top-dropdown-link,
.top-dropdown-empty {
    display: block;
    padding: 0.55rem 0.65rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.86rem;
}

.top-dropdown-link {
    color: #4f6c7f;
}

.top-dropdown-link:hover,
.top-dropdown-link.active {
    background: #e1eaf0;
    color: #2f4a5c;
}

.top-dropdown-empty {
    color: #8097a6;
}

.top-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    background: #eaf0f4;
    border: 1px solid #c5d3dd;
    border-radius: 10px;
    padding: 0.3rem 0.5rem;
}

.top-user-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: #2f4a5c;
}

.top-user-role {
    font-size: 0.7rem;
    color: #6f8796;
}

.top-user-toggle {
    list-style: none;
    cursor: pointer;
    position: relative;
    padding-right: 1.2rem;
}

.top-user-toggle::-webkit-details-marker {
    display: none;
}

.top-user-toggle::after {
    content: 'v';
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    opacity: 0.9;
}

.top-user-dropdown[open] .top-user-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}

.top-user-menu {
    right: 0;
    left: auto;
    min-width: 150px;
}

.top-user-logout-form {
    margin: 0;
}

.top-user-logout-btn {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.top-header .header-title {
    color: #2f4a5c;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    text-shadow: none;
}

.top-header .btn-secondary {
    border-color: #c5d3dd;
    background: #edf2f6;
    color: #4b677a;
}

.top-header .btn-secondary:hover {
    background: #dee8ef;
    color: #334f62;
}

[data-theme="dark"] .top-header {
    background: #1b2e3d;
    border-bottom: 1px solid #32485a;
}

[data-theme="dark"] .top-brand {
    border-color: #3a5265;
    background: #24394a;
}

[data-theme="dark"] .top-brand:hover {
    background: #2a4356;
}

[data-theme="dark"] .top-brand-media {
    border-color: #4a6579;
    background: #e9eff3;
}

[data-theme="dark"] .top-brand-kicker {
    color: #9db4c3;
}

[data-theme="dark"] .top-brand-text,
[data-theme="dark"] .top-header .header-title {
    color: #e8f1f6;
}

[data-theme="dark"] .top-dropdown-toggle {
    border-color: #3a5265;
    background: #24394a;
    color: #d4e3ec;
}

[data-theme="dark"] .top-dropdown[open] .top-dropdown-toggle,
[data-theme="dark"] .top-dropdown-toggle:hover {
    background: #2e495e;
    color: #f2f7fa;
}

[data-theme="dark"] .top-dropdown-menu {
    background: #213545;
    border-color: #395063;
    box-shadow: 0 14px 24px -16px rgba(2, 10, 18, 0.7);
}

[data-theme="dark"] .top-dropdown-link {
    color: #c7d9e5;
}

[data-theme="dark"] .top-dropdown-link:hover,
[data-theme="dark"] .top-dropdown-link.active {
    background: #2d475b;
    color: #f3f8fb;
}

[data-theme="dark"] .top-dropdown-empty {
    color: #9ab2c2;
}

[data-theme="dark"] .top-user {
    background: #24394a;
    border-color: #3a5265;
}

[data-theme="dark"] .top-user-name {
    color: #e8f1f6;
}

[data-theme="dark"] .top-user-role {
    color: #9db4c3;
}

[data-theme="dark"] .top-header .btn-secondary {
    border-color: #3a5265;
    background: #24394a;
    color: #d1e1ea;
}

[data-theme="dark"] .top-header .btn-secondary:hover {
    background: #2e495e;
    color: #f2f7fa;
}

@keyframes top-dropdown-enter {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Theme Toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* Page Content */
.page-content {
    padding: 1.5rem;
}

.home-intro {
    position: relative;
    background: #f2f6f9;
    border: 1px solid #c7d4de;
    border-left: 6px solid #4f6f82;
    color: #243b4b;
    overflow: hidden;
}

.home-intro::after {
    content: none;
}

.home-intro-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.home-intro-kicker {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.7rem;
    color: #5f7a8d;
    margin-bottom: 0.42rem;
}

.home-intro-title {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: clamp(1.18rem, 2.4vw, 1.48rem);
    margin-bottom: 0.4rem;
}

.home-intro-text {
    color: #4f6777;
    max-width: 62ch;
    font-size: 0.93rem;
}

.home-intro-period {
    border-radius: 999px;
    border: 1px solid #b9c9d5;
    background: #e7eef3;
    padding: 0.42rem 0.78rem;
    font-size: 0.8rem;
    color: #2f4a5d;
    white-space: nowrap;
}

.home-intro-metrics {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.75rem;
}

.home-intro-pill {
    border: 1px solid #c7d4de;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.54rem 0.72rem;
}

.home-intro-pill-label {
    display: block;
    font-size: 0.7rem;
    color: #6a8393;
    margin-bottom: 0.18rem;
}

.home-intro-pill-value {
    display: block;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #243b4b;
    font-size: 0.88rem;
}

/* ============ KPI CARDS ============ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-card.ingresos::before { background: #6f8fa4; }
.kpi-card.gastos::before { background: #9a7f67; }
.kpi-card.utilidad::before { background: #6f907f; }
.kpi-card.gastos-fin::before { background: #b86666; }
.kpi-card.resultado::before { background: #5f7f93; }

.kpi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.kpi-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.kpi-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card.ingresos .kpi-card-icon { background: rgba(111, 143, 164, 0.14); color: #5a768a; }
.kpi-card.gastos .kpi-card-icon { background: rgba(154, 127, 103, 0.14); color: #7f644e; }
.kpi-card.utilidad .kpi-card-icon { background: rgba(111, 144, 127, 0.14); color: #54715f; }
.kpi-card.gastos-fin .kpi-card-icon { background: rgba(184, 102, 102, 0.14); color: #8e4e4e; }
.kpi-card.resultado .kpi-card-icon { background: rgba(95, 127, 147, 0.14); color: #4e6879; }

.kpi-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.kpi-card-trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.kpi-card-trend.positive { color: var(--accent-success); }
.kpi-card-trend.negative { color: var(--accent-danger); }

/* ============ CHARTS ============ */
.chart-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* ============ DATA TABLE ============ */
.data-table-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.data-table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.data-table-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table td {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.data-table .number {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    text-align: right;
}

.data-table .positive { color: var(--accent-success); }
.data-table .negative { color: var(--accent-danger); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-success {
    background: var(--accent-success);
    color: white;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* ============ FORM ELEMENTS ============ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ============ FILE UPLOAD ============ */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    background: var(--bg-tertiary);
    transition: all var(--transition-base);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-zone-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

.upload-zone-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-zone-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============ ALERTS ============ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-info);
}

/* ============ GRID LAYOUTS ============ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ============ UTILITIES ============ */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* ============ LOGIN PAGE ============ */
.marine-login-page {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background:
        radial-gradient(980px 420px at 88% 8%, rgba(89, 143, 172, 0.2), transparent 62%),
        radial-gradient(700px 360px at 4% 88%, rgba(21, 63, 94, 0.42), transparent 68%),
        linear-gradient(165deg, #061a2a 0%, #0a2f45 56%, #0d3c56 100%);
    color: #ecf6fa;
    overflow-x: hidden;
}

.marine-login-shell {
    min-height: 100vh;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 2.25rem;
    display: grid;
    grid-template-columns: 1.15fr minmax(340px, 420px);
    gap: 1.75rem;
    align-items: center;
}

.marine-login-center {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.marine-hero {
    position: relative;
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid rgba(228, 246, 255, 0.2);
    background: linear-gradient(150deg, rgba(7, 43, 66, 0.65), rgba(9, 69, 97, 0.22));
    box-shadow: 0 28px 54px -26px rgba(3, 20, 32, 0.7);
    backdrop-filter: blur(4px);
    animation: marine-fade 450ms ease;
}

.marine-hero::before,
.marine-hero::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.marine-hero::before {
    width: 240px;
    height: 240px;
    right: -64px;
    top: -82px;
    background: radial-gradient(circle at 30% 30%, rgba(121, 236, 255, 0.42), rgba(121, 236, 255, 0));
}

.marine-hero::after {
    width: 260px;
    height: 260px;
    left: -96px;
    bottom: -130px;
    background: radial-gradient(circle at 40% 35%, rgba(11, 134, 181, 0.42), rgba(11, 134, 181, 0));
}

.marine-hero-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(185, 239, 253, 0.35);
    background: rgba(9, 57, 86, 0.62);
    letter-spacing: 0.03em;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #d7eff9;
}

.marine-hero-title {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(2rem, 4.2vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 0.9rem;
    color: #f4fbff;
}

.marine-hero-subtitle {
    max-width: 50ch;
    color: rgba(225, 246, 255, 0.88);
    font-size: 1.06rem;
    margin-bottom: 1.6rem;
}

.marine-hero-points {
    display: grid;
    gap: 0.8rem;
}

.marine-point {
    border-left: 3px solid rgba(123, 227, 245, 0.78);
    background: rgba(8, 46, 70, 0.47);
    padding: 0.66rem 0.82rem;
    border-radius: 8px;
    color: #daf1fb;
}

.marine-access-card {
    position: relative;
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.97), rgba(246, 251, 253, 0.95));
    color: #162f41;
    padding: 1.75rem;
    border: 1px solid rgba(170, 198, 214, 0.68);
    box-shadow: 0 20px 34px -22px rgba(3, 24, 37, 0.55);
    animation: marine-rise 460ms ease;
}

.marine-access-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, #103a53 0%, #1a5a78 65%, #b79a63 100%);
}

.marine-access-card.marine-centered {
    width: min(440px, 100%);
    padding: 1.8rem;
}

.marine-brand-center {
    flex-direction: column;
    text-align: center;
}

.marine-brand-logo-lg {
    width: min(190px, 72vw);
    height: 78px;
    border-radius: 12px;
}

.marine-brand-fallback.marine-brand-logo-lg {
    width: 72px;
    height: 72px;
    border-radius: 14px;
}

.marine-login-intro {
    text-align: center;
    color: #46677c;
    margin: 0.2rem 0 1.1rem;
    font-size: 0.97rem;
}

.marine-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.3rem;
}

.marine-brand-logo,
.marine-brand-fallback {
    width: 58px;
    height: 58px;
    border-radius: 14px;
}

.marine-brand-logo {
    object-fit: contain;
    border: 1px solid rgba(133, 179, 200, 0.28);
    background: rgba(247, 252, 255, 0.85);
    padding: 0.2rem;
}

.marine-brand-fallback {
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, #0c719a, #1577ad);
    color: #eef9ff;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.marine-brand-kicker {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.68rem;
    color: #5b7d91;
}

.marine-brand-name {
    font-family: 'Manrope', sans-serif;
    font-size: 1.28rem;
    line-height: 1.2;
    color: #0b2b3f;
}

.marine-login-form {
    margin-top: 0.45rem;
}

.marine-label {
    color: #2d4d62;
    font-weight: 600;
}

.marine-input {
    background: #fbfdff;
    border: 1px solid #bfd7e4;
    color: #173447;
}

.marine-input::placeholder {
    color: #7694a8;
}

.marine-input:focus {
    border-color: #175f86;
    box-shadow: 0 0 0 3px rgba(23, 95, 134, 0.16);
}

.marine-login-btn {
    width: 100%;
    margin-top: 0.35rem;
    border: 1px solid #184762;
    background: #144764;
    color: #eef7fb;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.marine-login-btn:hover {
    color: #eef7fb;
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -14px rgba(8, 50, 73, 0.78);
    filter: brightness(1.05);
}

.marine-login-btn:active {
    transform: translateY(0);
}

.marine-access-footnote {
    margin-top: 1.1rem;
    font-size: 0.82rem;
    color: #4d6f84;
    text-align: center;
}

@keyframes marine-fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes marine-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ LOGIN MG ============ */
.mg-login-page {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: #e5ecf1;
    color: #203644;
}

.mg-login-shell {
    min-height: 100vh;
    width: min(1160px, 100%);
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(360px, 450px);
    gap: 1.6rem;
    align-items: center;
}

.mg-login-story {
    border: 1px solid #c4d1da;
    border-radius: 22px;
    background: #eef3f7;
    padding: 2rem;
    box-shadow: 0 16px 28px -24px rgba(17, 39, 54, 0.36);
}

.mg-login-story-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: #668095;
    margin-bottom: 0.7rem;
}

.mg-login-story-title {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.12;
    margin-bottom: 0.7rem;
    color: #29475b;
}

.mg-login-story-text {
    color: #4e697b;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    max-width: 50ch;
}

.mg-login-story-points {
    display: grid;
    gap: 0.64rem;
}

.mg-login-story-point {
    border-left: 3px solid #6e8ba0;
    border-radius: 8px;
    background: #ffffff;
    color: #385567;
    padding: 0.56rem 0.75rem;
    font-size: 0.94rem;
}

.mg-login-card {
    border-radius: 20px;
    border: 1px solid #cdd7de;
    background: #fafcfd;
    color: #213949;
    box-shadow: 0 16px 28px -24px rgba(16, 35, 48, 0.34);
    padding: 1.55rem;
}

.mg-login-brand {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 0.95rem;
}

.mg-login-brand-logo-wrap {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    border: 1px solid #c2d0d9;
    background: rgba(246, 250, 252, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 70px;
}

.mg-login-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.26rem;
}

.mg-login-brand-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
    color: #f3f6f8;
    background: #5d7f93;
}

.mg-login-brand-kicker {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.66rem;
    color: #6b8290;
}

.mg-login-brand-name {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.2rem;
    color: #2b4759;
    line-height: 1.2;
}

.mg-login-intro {
    color: #607887;
    margin-bottom: 1rem;
    font-size: 0.94rem;
}

.mg-login-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 10px;
    border: 1px solid #d5aaaa;
    background: #f7eded;
    color: #7e2b2b;
    padding: 0.62rem 0.74rem;
    margin-bottom: 0.9rem;
    font-size: 0.88rem;
}

.mg-login-form {
    margin-top: 0.25rem;
}

.mg-login-label {
    color: #38566a;
    font-weight: 600;
}

.mg-login-input {
    background: #f7fafc;
    border-color: #c7d4dd;
    color: #243f4f;
}

.mg-login-input::placeholder {
    color: #8a9ba7;
}

.mg-login-input:focus {
    border-color: #5e7e90;
    box-shadow: 0 0 0 3px rgba(94, 126, 144, 0.15);
}

.mg-login-submit {
    width: 100%;
    margin-top: 0.3rem;
    border: 1px solid #58798d;
    background: #648699;
    color: #f2f6f8;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 700;
}

.mg-login-submit:hover {
    background: #567789;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px -14px rgba(32, 62, 80, 0.48);
}

.mg-login-footnote {
    margin-top: 0.95rem;
    text-align: center;
    font-size: 0.8rem;
    color: #708593;
}

/* ============ RESPONSIVE UTILITIES ============ */
.section-gap-sm {
    margin-top: 1rem;
}

.section-gap-md {
    margin-top: 1.5rem;
}

.header-action-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-action-inline .form-control {
    width: auto;
}

.chart-header-responsive {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.action-wrap {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.empty-note {
    padding: 1.5rem;
    color: var(--text-muted);
    text-align: center;
}

.summary-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.summary-block-head {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.summary-block-title {
    font-weight: 600;
}

.summary-block-metrics {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.summary-block-body {
    margin-top: 0.75rem;
}

.summary-block-body-sm {
    margin-top: 0.5rem;
}

.summary-block-nested {
    margin-top: 0.75rem;
}

.line-title-cell {
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.line-item-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.line-item-title {
    font-weight: 600;
}

.port-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.port-hero-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 56px;
}

.port-hero-copy {
    min-width: 0;
}

.port-hero-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.port-hero-badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.port-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.port-chip-link {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.port-chip-link:hover {
    background: var(--bg-hover);
}

.compare-toolbar {
    margin-bottom: 1.25rem;
}

.compare-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.compare-field {
    margin-bottom: 0;
    min-width: 200px;
    flex: 1 1 200px;
}

.compare-field-wide {
    min-width: 240px;
    flex-basis: 260px;
}

.compare-submit {
    white-space: nowrap;
}

.compare-alert {
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-warning);
}

.compare-summary {
    margin-bottom: 1rem;
}

.compare-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.compare-kpi-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.compare-detail-grid {
    margin-top: 1rem;
}

.compare-development {
    margin-top: 1rem;
    max-width: 940px;
    margin-left: auto;
    margin-right: auto;
}

.compare-development .chart-header {
    justify-content: center;
}

.compare-development .chart-title {
    text-align: center;
}

.compare-dev-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(170px, 220px));
    gap: 0.9rem;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.compare-dev-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-height: 150px;
    display: grid;
    place-content: center;
    text-align: center;
    background: var(--bg-secondary);
    padding: 0.75rem;
}

.compare-dev-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compare-dev-value {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
}

.compare-dev-meta {
    justify-content: center;
}

.compare-dev-table th,
.compare-dev-table td,
.compare-dev-table .number {
    text-align: center;
}

.compare-dev-table {
    min-width: 0;
}

.compare-detail-stack {
    display: grid;
    gap: 0.75rem;
}

.tabs-responsive {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.tabs-responsive .tab-btn {
    flex: 1;
}

.table-tabs-shell {
    padding: 1rem;
    padding-bottom: 0;
}

.table-tabs-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.table-tabs-row .table-tab-btn {
    white-space: nowrap;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .main-content {
        margin-left: 0;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .header {
        height: auto;
        min-height: var(--header-height);
        flex-wrap: wrap;
        gap: 0.65rem;
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .top-header {
        align-items: center;
    }

    .top-header-left {
        width: 100%;
        justify-content: space-between;
    }

    .top-brand {
        max-width: 220px;
    }

    .top-menu-toggle {
        display: inline-flex !important;
    }

    .top-header-collapsible {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        border-top: 1px solid #cad6df;
        padding-top: 0.65rem;
        margin-top: 0.35rem;
    }

    .top-header-collapsible.open {
        display: flex;
    }

    .top-nav-dropdowns,
    .top-header-right {
        width: 100%;
    }

    .top-nav-dropdowns {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .top-dropdown-menu {
        position: static;
        min-width: 0;
        margin-top: 0.35rem;
        animation: none;
    }

    .top-header-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .top-header-right form {
        width: 100%;
    }

    .top-header-right .form-control {
        width: 100% !important;
    }

    .top-user {
        align-items: flex-start;
    }

    .chart-header-responsive {
        flex-direction: column;
        align-items: stretch;
    }

    .action-wrap {
        width: 100%;
    }

    .action-wrap .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .compare-field,
    .compare-field-wide {
        min-width: 0;
        flex: 1 1 100%;
    }

    .compare-submit {
        width: 100%;
    }

    .compare-kpi-split {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .summary-block-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-block-metrics {
        justify-content: flex-start;
    }

    .port-hero {
        align-items: flex-start;
    }

    .port-hero-title {
        font-size: 1.08rem;
    }

    .tabs-responsive {
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        flex-wrap: wrap;
    }

    .tabs-responsive .tab-btn {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }

    .table-tabs-row {
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        flex-wrap: wrap;
    }

    .table-tabs-row .table-tab-btn {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 0 1rem;
    }

    .header-right {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .header-right form {
        max-width: 100%;
    }

    .header-action-inline {
        width: 100%;
    }

    .header-action-inline .form-control {
        width: 100%;
    }

    .header-right .form-control {
        padding: 0.55rem 0.7rem;
        font-size: 0.8rem;
    }

    .header-title {
        font-size: 1.05rem;
    }

    .top-header-left {
        gap: 0.5rem;
    }

    .top-brand {
        padding-right: 0.5rem;
        max-width: calc(100% - 58px);
    }

    .top-brand-kicker {
        display: none;
    }

    .top-brand-text {
        font-size: 0.72rem;
    }

    .top-header .header-title {
        font-size: 0.95rem;
    }

    .top-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .page-content {
        padding: 0.85rem;
    }

    .home-intro-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }

    .home-intro-metrics {
        grid-template-columns: 1fr;
    }

    .chart-container,
    .kpi-card,
    .data-table-header {
        padding: 1rem;
    }

    .upload-zone {
        padding: 1.4rem 1rem;
    }

    .data-table {
        min-width: 560px;
    }

    .compare-summary-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .compare-dev-cards {
        grid-template-columns: 1fr;
        max-width: 260px;
        margin-left: auto;
        margin-right: auto;
    }

    .compare-dev-meta {
        align-items: center;
    }

    .line-item-wrap {
        align-items: flex-start;
    }

    .port-chip-wrap {
        gap: 0.5rem;
    }

    .port-chip-link {
        padding: 0.42rem 0.72rem;
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.55rem 0.6rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .tabs-responsive .tab-btn {
        min-height: 42px;
        padding: 0.62rem 0.75rem;
        font-size: 0.82rem;
    }

    .tabs-responsive .tab-btn svg {
        width: 16px;
        height: 16px;
    }

    .marine-login-shell {
        padding: 1rem;
        gap: 1rem;
        grid-template-columns: 1fr;
    }

    .marine-hero {
        padding: 1.4rem;
    }

    .marine-hero-title {
        font-size: 1.75rem;
    }

    .marine-hero-subtitle {
        font-size: 0.97rem;
    }

    .marine-point {
        font-size: 0.9rem;
    }

    .marine-access-card {
        padding: 1.2rem;
    }

    .marine-access-card.marine-centered {
        width: 100%;
        padding: 1.25rem;
    }

    .marine-brand-name {
        font-size: 1.2rem;
    }

    .marine-brand-logo-lg {
        width: min(160px, 68vw);
        height: 64px;
    }

    .mg-login-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .mg-login-story,
    .mg-login-card {
        padding: 1.2rem;
    }

    .mg-login-story-title {
        font-size: 1.56rem;
    }

    .mg-login-brand-logo-wrap {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
    }
}

@media (max-width: 520px) {
    .top-header .header-title {
        display: none;
    }

    .page-content {
        padding: 0.65rem;
    }

    .chart-container,
    .kpi-card,
    .data-table-header {
        padding: 0.85rem;
    }

    .table-tabs-shell {
        padding: 0.75rem;
        padding-bottom: 0;
    }

    .tabs-responsive .tab-btn,
    .table-tabs-row .table-tab-btn {
        flex-basis: 100%;
    }

    .tabs-responsive .tab-btn {
        justify-content: flex-start;
    }

    .mg-login-story {
        display: none;
    }

    .mg-login-shell {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .marine-login-shell {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .mg-login-shell {
        grid-template-columns: 1fr;
        max-width: 760px;
    }
}
