/* ============================================================
   SYT Panel — SOLYTEC Design System
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --color-primary: #003B73;
    --color-secondary: #0070C9;
    --color-accent: #29A8E0;
    --color-lime: #8BC53F;
    --color-gray-light: #F2F4F7;
    --color-gray: #9CA3AF;
    --color-gray-dark: #374151;
    --color-white: #FFFFFF;
    --color-danger: #EF4444;
    --color-danger-light: #FEE2E2;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-info-light: #EFF6FF;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, .07), 0 2px 4px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, .1), 0 4px 6px rgba(0, 0, 0, .05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, .15), 0 10px 10px rgba(0, 0, 0, .04);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

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

    --transition: 0.2s ease;
    --sidebar-w: 260px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    background: var(--color-gray-light);
    color: var(--color-gray-dark);
    line-height: 1.6;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent);
}

/* ============================================================
   AUTH LAYOUT
   ============================================================ */

.auth-body {
    background: linear-gradient(135deg, var(--color-primary) 0%, #001d45 40%, #002a5c 70%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(41, 168, 224, .15) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.auth-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 197, 63, .1) 0%, transparent 70%);
    bottom: -100px;
    left: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, .15);
    animation: slideUp .4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.logo-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.auth-logo-text {
    display: flex;
    flex-direction: column;
}

.logo-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: .05em;
}

.logo-sub {
    font-size: .75rem;
    color: var(--color-gray);
    letter-spacing: .04em;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: .25rem;
}

.auth-subtitle {
    font-size: .875rem;
    color: var(--color-gray);
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-footer {
    text-align: center;
    font-size: .75rem;
    color: var(--color-gray);
    margin-top: 1.5rem;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .875rem 1rem;
    border-radius: var(--radius-md);
    font-size: .875rem;
    margin-bottom: 1.25rem;
    animation: fadeIn .3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error {
    background: var(--color-danger-light);
    color: #B91C1C;
    border-left: 3px solid var(--color-danger);
}

.alert-info {
    background: var(--color-info-light);
    color: #1E40AF;
    border-left: 3px solid var(--color-secondary);
}

.alert-warning {
    background: var(--color-warning-light);
    color: #92400E;
    border-left: 3px solid var(--color-warning);
}

.alert-success {
    background: var(--color-success-light);
    color: #065F46;
    border-left: 3px solid var(--color-success);
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-gray-dark);
    margin-bottom: .4rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: .875rem;
    color: var(--color-gray);
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: .75rem .875rem .75rem 2.75rem;
    border: 1.5px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-family: var(--font-base);
    font-size: .9rem;
    color: var(--color-gray-dark);
    background: var(--color-white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 112, 201, .12);
}

.form-input::placeholder {
    color: #9CA3AF;
}

.toggle-password {
    position: absolute;
    right: .875rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray);
    padding: .25rem;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.toggle-password:hover {
    color: var(--color-secondary);
}

/* Date inputs */
.form-input[type="date"] {
    cursor: pointer;
}

.form-select {
    width: 100%;
    padding: .75rem .875rem;
    border: 1.5px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-family: var(--font-base);
    font-size: .9rem;
    color: var(--color-gray-dark);
    background: var(--color-white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .875rem center;
    padding-right: 2.5rem;
}

.form-select:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 112, 201, .12);
}

.field-error {
    font-size: .8rem;
    color: var(--color-danger);
    margin-top: .3rem;
    display: none;
    align-items: center;
    gap: .3rem;
}

.field-error.visible {
    display: flex;
}

.field-warning {
    font-size: .8rem;
    color: var(--color-warning);
    margin-top: .3rem;
    display: none;
    align-items: center;
    gap: .3rem;
}

.field-warning.visible {
    display: flex;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-base);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--transition);
}

.btn:hover::after {
    background: rgba(255, 255, 255, .1);
}

.btn:active {
    transform: scale(.98);
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(0, 112, 201, .4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 112, 201, .5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-secondary);
    border: 1.5px solid var(--color-secondary);
}

.btn-secondary:hover {
    background: rgba(0, 112, 201, .06);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-ghost {
    background: transparent;
    color: var(--color-gray-dark);
    border: 1.5px solid #E5E7EB;
}

.btn-ghost:hover {
    background: var(--color-gray-light);
}

.btn-sm {
    padding: .5rem .875rem;
    font-size: .8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: .9rem 1.75rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1.5px solid #E5E7EB;
    color: var(--color-gray);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--color-gray-light);
    color: var(--color-gray-dark);
}

.btn-icon.btn-icon-danger:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-icon.btn-icon-primary:hover {
    background: rgba(0, 112, 201, .1);
    color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.btn-spinner {
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--color-primary) 0%, #001d3f 100%);
    color: var(--color-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.sidebar-logo {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .875rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    width: 196px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .04em;
}

.sidebar-sub {
    font-size: .7rem;
    opacity: .65;
    letter-spacing: .03em;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 .75rem;
    margin-bottom: .75rem;
}

.nav-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .45;
    padding: 0 .5rem .5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .875rem;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, .75);
    font-size: .875rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--color-white);
}

.nav-item.active {
    background: rgba(41, 168, 224, .2);
    color: var(--color-white);
    border-left: 3px solid var(--color-accent);
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .875rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-lime));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .875rem;
    color: var(--color-white);
    flex-shrink: 0;
}

.user-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--color-white);
}

.user-role {
    font-size: .7rem;
    opacity: .6;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top bar */
.topbar {
    background: var(--color-white);
    border-bottom: 1px solid #E5E7EB;
    padding: .875rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.page-breadcrumb {
    font-size: .8rem;
    color: var(--color-gray);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.topbar-badge {
    background: var(--color-gray-light);
    padding: .3rem .75rem;
    border-radius: 20px;
    font-size: .8rem;
    color: var(--color-gray-dark);
    font-weight: 500;
}

/* Page body */
.page-body {
    padding: 2rem;
    flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #F0F0F0;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #F0F0F0;
    background: var(--color-gray-light);
}

/* Client cards grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.client-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid #F0F0F0;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-secondary), var(--color-accent));
}

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

.client-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.client-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.client-reports-badge {
    background: var(--color-gray-light);
    color: var(--color-gray-dark);
    padding: .25rem .625rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.client-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: .25rem;
}

.client-id {
    font-size: .75rem;
    color: var(--color-gray);
    font-family: monospace;
}

.client-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--color-gray);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-gray);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: var(--color-gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray);
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-gray-dark);
    margin-bottom: .5rem;
}

.empty-state-desc {
    font-size: .875rem;
    margin-bottom: 1.5rem;
}

/* ============================================================
   STATS ROW
   ============================================================ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #F0F0F0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: rgba(0, 112, 201, .1);
    color: var(--color-secondary);
}

.stat-icon.cyan {
    background: rgba(41, 168, 224, .1);
    color: var(--color-accent);
}

.stat-icon.lime {
    background: rgba(139, 197, 63, .1);
    color: var(--color-lime);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    font-size: .8rem;
    color: var(--color-gray);
    margin-top: .2rem;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */

.search-bar {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.search-bar svg {
    position: absolute;
    left: .875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: .65rem .875rem .65rem 2.75rem;
    border: 1.5px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-family: var(--font-base);
    font-size: .875rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--color-white);
    color: var(--color-gray-dark);
}

.search-input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 112, 201, .1);
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

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

.table th {
    background: var(--color-gray-light);
    text-align: left;
    padding: .875rem 1rem;
    font-weight: 600;
    color: var(--color-gray-dark);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.table td {
    padding: .875rem 1rem;
    border-bottom: 1px solid #F0F0F0;
    color: var(--color-gray-dark);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(0, 112, 201, .02);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ============================================================
   REPORT GENERATION PANEL
   ============================================================ */

.generate-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .generate-panel {
        grid-template-columns: 1fr;
    }
}

.date-range-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2.2rem;
    color: var(--color-gray);
    font-size: .8rem;
}

/* ============================================================
   REPORT PREVIEW
   ============================================================ */

.report-preview-container {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.preview-topbar {
    background: var(--color-primary);
    padding: .875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.preview-dots {
    display: flex;
    gap: .4rem;
}

.preview-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.preview-dots span:nth-child(1) {
    background: #FF5F57;
}

.preview-dots span:nth-child(2) {
    background: #FFBD2E;
}

.preview-dots span:nth-child(3) {
    background: #28CA41;
}

.preview-title {
    font-size: .8rem;
    font-weight: 500;
    opacity: .8;
}

.preview-actions {
    display: flex;
    gap: .5rem;
}

.preview-frame {
    width: 100%;
    min-height: 500px;
    border: none;
    display: block;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    flex-direction: column;
    gap: 1.5rem;
}

.loading-overlay.active {
    display: flex;
}

.loading-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem 3rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 380px;
    width: 90%;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--color-gray-light);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: .5rem;
}

.loading-desc {
    font-size: .875rem;
    color: var(--color-gray);
}

.loading-progress {
    margin-top: 1.25rem;
    height: 4px;
    background: var(--color-gray-light);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    border-radius: 2px;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0% {
        width: 5%;
    }

    50% {
        width: 75%;
    }

    100% {
        width: 90%;
    }
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn .2s ease;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    animation: slideUp .25s ease;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-danger-light);
    color: var(--color-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-gray-dark);
    text-align: center;
    margin-bottom: .5rem;
}

.modal-desc {
    font-size: .875rem;
    color: var(--color-gray);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: .75rem;
}

.modal-actions .btn {
    flex: 1;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .625rem;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: .875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .875rem;
    min-width: 280px;
    max-width: 380px;
    border-left: 4px solid;
    animation: toastIn .3s ease;
    pointer-events: all;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-exit {
    animation: toastOut .3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

.toast-success {
    border-color: var(--color-success);
}

.toast-error {
    border-color: var(--color-danger);
}

.toast-warning {
    border-color: var(--color-warning);
}

.toast-info {
    border-color: var(--color-secondary);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--color-success);
}

.toast-error .toast-icon {
    color: var(--color-danger);
}

.toast-warning .toast-icon {
    color: var(--color-warning);
}

.toast-info .toast-icon {
    color: var(--color-secondary);
}

/* ============================================================
   BADGES & CHIPS
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(0, 112, 201, .1);
    color: var(--color-secondary);
}

.badge-success {
    background: var(--color-success-light);
    color: #065F46;
}

.badge-gray {
    background: var(--color-gray-light);
    color: var(--color-gray-dark);
}

/* ============================================================
   SYNC INFO ROW
   ============================================================ */

.sync-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--color-gray);
    padding: .5rem .875rem;
    background: var(--color-gray-light);
    border-radius: var(--radius-md);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-lime);
    flex-shrink: 0;
}

/* ============================================================
   UTILITY
   ============================================================ */

.spin {
    animation: spin .8s linear infinite;
}

.d-none {
    display: none !important;
}

.text-muted {
    color: var(--color-gray);
}

.text-primary {
    color: var(--color-primary);
}

.text-secondary {
    color: var(--color-secondary);
}

.text-sm {
    font-size: .875rem;
}

.text-xs {
    font-size: .75rem;
}

.font-mono {
    font-family: monospace;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-1 {
    margin-top: .5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.gap-1 {
    gap: .5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-between {
    justify-content: space-between;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .page-body {
        padding: 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .date-range-row {
        grid-template-columns: 1fr;
    }
}