/* Visual refresh - Corporate Clean */

:root {
    --bg-soft: #f3f6fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text-main: #0f172a;
    --text-soft: #64748b;
    --brand-500: #2563eb;
    --brand-600: #1d4ed8;
    --brand-700: #1e40af;
    --line: #e2e8f0;
    --radius-xl: 16px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body {
    background: linear-gradient(180deg, #f8fbff 0%, var(--bg-soft) 100%);
    color: var(--text-main);
}

.app-navbar {
    background: linear-gradient(90deg, var(--brand-700) 0%, var(--brand-500) 65%, #3b82f6 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.2);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-content {
    min-height: calc(100vh - 220px);
}

.app-footer {
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #cbd5e1;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.footer-shell {
    padding-top: 0.65rem;
    padding-bottom: 0.5rem;
}

.footer-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-500), #38bdf8);
    color: #eff6ff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.footer-title {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 0.55rem;
}

.footer-links li {
    margin-bottom: 0.2rem;
    color: #94a3b8;
    font-size: 0.84rem;
}

.footer-links a {
    color: #e2e8f0;
    text-decoration: none;
}

.footer-links a:hover {
    color: #93c5fd;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.footer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.22rem 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    font-size: 0.72rem;
}

.footer-bottom {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    font-size: 0.72rem;
}

.fade-in {
    animation: appFadeIn 0.25s ease-out;
}

@keyframes appFadeIn {
    from {
        opacity: 0.92;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    border-bottom: 1px solid var(--line);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    border-color: var(--brand-600);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    border-color: var(--brand-700);
}

.btn-outline-light:hover {
    color: var(--brand-700);
}

.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}

.table thead th {
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-bottom: none;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.table tbody td {
    vertical-align: middle;
    border-color: #eef2f7;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

.alert {
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 12px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.1rem;
    height: 100%;
}

.kpi-label {
    color: var(--text-soft);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.hero-panel {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.28), rgba(37, 99, 235, 0.95));
    color: #eff6ff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.25);
}

.hero-title {
    font-size: 1.6rem;
    font-weight: 800;
}

.hero-sub {
    color: #dbeafe;
    margin: 0;
}

.quick-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.quick-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    color: white;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
}

.app-nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    border-radius: 8px;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.1rem;
    height: 100%;
    position: relative;
}

.summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
}

.summary-card.summary-info::before {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.summary-card.summary-success::before {
    background: linear-gradient(135deg, #059669, #10b981);
}

.summary-card.summary-warning::before {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.summary-card.summary-primary::before {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.summary-card .summary-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.summary-card .summary-value {
    font-size: 1.5rem;
    line-height: 1.1;
    font-weight: 800;
}

.module-toolbar .btn {
    min-width: 128px;
}

.sticky-filters {
    position: sticky;
    top: 74px;
    z-index: 20;
    backdrop-filter: blur(4px);
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}

.table-actions .btn {
    min-width: 34px;
    border-radius: 9px !important;
}

.table-actions .btn + .btn {
    margin-left: 4px;
}

.empty-state {
    padding: 1.2rem 0.5rem;
}

.empty-state i {
    opacity: 0.6;
}

.empty-state h5,
.empty-state h4 {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.alert-section .alert {
    border-radius: 12px;
}

.card-header.bg-light,
.card-header.bg-info,
.card-header.bg-success,
.card-header.bg-warning,
.card-header.bg-primary,
.card-header.bg-danger,
.card-header.bg-secondary {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600)) !important;
    color: #eff6ff !important;
}

body.compact-mode .table tbody td {
    padding: 0.55rem 0.7rem;
    font-size: 0.88rem;
}

body.compact-mode .table thead th {
    padding: 0.6rem 0.7rem;
    font-size: 0.73rem;
}

body.compact-mode .stats-card {
    height: 100px;
}

body.compact-mode .stats-card .card-body {
    padding: 1rem;
}

body.compact-mode .stats-card .stats-value,
body.compact-mode .summary-card .summary-value,
body.compact-mode .kpi-value {
    font-size: 1.25rem;
}

.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fbff 0%, var(--bg-soft) 100%);
}

.auth-layout {
    min-height: 100vh;
}

.auth-hero {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.28), rgba(37, 99, 235, 0.95));
    color: #eff6ff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.2);
}

.auth-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    background: var(--surface);
}

.auth-card .card-body {
    padding: 1.5rem;
}

.auth-logo {
    height: 56px;
    max-width: 210px;
    object-fit: contain;
}

.theme-dark {
    --bg-soft: #0b1220;
    --surface: #111827;
    --surface-muted: #1f2937;
    --text-main: #e5e7eb;
    --text-soft: #94a3b8;
    --line: #334155;
}

.theme-dark body,
body.theme-dark {
    background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
    color: var(--text-main);
}

body.theme-dark .card,
body.theme-dark .quick-card,
body.theme-dark .kpi-card {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text-main);
}

body.theme-dark .text-muted {
    color: var(--text-soft) !important;
}

body.theme-dark .table thead th {
    background: #0f172a;
    color: #cbd5e1;
}

body.theme-dark .table tbody td {
    border-color: #1f2937;
    color: var(--text-main);
    background: var(--surface);
}

body.theme-dark .table tbody tr:hover td {
    background: #1f2937;
}

body.theme-dark .form-control,
body.theme-dark .form-select {
    background: #0f172a;
    border-color: var(--line);
    color: var(--text-main);
}

body.theme-dark .card-header {
    background: #0f172a;
    color: #e2e8f0;
    border-bottom-color: #1f2937;
}

body.theme-dark .app-footer {
    background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
}

body.theme-dark .footer-chip {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.6);
}

@media (max-width: 991.98px) {
    .hero-panel {
        padding: 1rem;
        border-radius: 16px;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .module-toolbar {
        width: 100%;
    }

    .module-toolbar .btn {
        width: 100%;
        min-width: 0;
        margin-bottom: 0.4rem;
    }

    .sticky-filters {
        position: static;
        top: auto;
        backdrop-filter: none;
    }

    .table-actions .btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.42rem 0.55rem;
    }

    .btn {
        min-height: 40px;
    }

    .table {
        font-size: 0.88rem;
    }

    .table thead th,
    .table tbody td {
        white-space: nowrap;
    }

    .footer-meta {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .card {
        border-radius: 14px;
    }

    .stats-card {
        height: auto;
        min-height: 96px;
    }

    .stats-card .card-body {
        padding: 0.95rem;
    }

    .stats-card .stats-value {
        font-size: 1.35rem;
    }

    .summary-card .summary-value,
    .kpi-value {
        font-size: 1.2rem;
    }

    .pagination .page-link {
        padding: 0.45rem 0.6rem;
        font-size: 0.8rem;
    }

    .app-footer {
        margin-top: 2rem !important;
    }

    #supportModal .modal-dialog {
        max-width: 100%;
        margin: 0.35rem;
    }

    #supportModal .modal-content {
        height: 95vh;
    }

    #supportModal .modal-body {
        height: calc(95vh - 58px);
    }

    #supportModal #supportFrame,
    #supportModal #supportImage {
        height: 100% !important;
        max-height: 100% !important;
    }
}

@media (max-width: 575.98px) {
    .app-navbar .navbar-brand img {
        height: 38px !important;
        max-width: 140px !important;
    }

    .hero-sub {
        font-size: 0.9rem;
    }

    .table thead th {
        font-size: 0.7rem;
    }

    .table tbody td {
        font-size: 0.82rem;
    }

    .table-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .table-actions .btn + .btn {
        margin-left: 0;
    }

    .auth-card .card-body {
        padding: 1rem;
    }

    .auth-logo {
        height: 46px;
        max-width: 170px;
    }
}

