/* ========================================
   ASSIDUOUS DESIGN SYSTEM
   Universal Stylesheet for Assiduous Realty
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   CSS Variables - Assiduous Design Tokens
   ======================================== */
:root {
    /* Core Brand Colors */
    --navy: #0B1F41;
    --sky: #60A3D9;
    --mist: #E2E8F0;
    --slate: #6B7280;
    --accent: #FFD940;
    
    /* Alias Variables for compatibility */
    --primary: #60A3D9;  /* Sky blue */
    --secondary: #0B1F41; /* Navy */
    --dark: #0B1F41;     /* Navy */
    --light: #F3F4F6;    /* Gray-100 */
    --gradient: linear-gradient(135deg, #60A3D9 0%, #0B1F41 100%); /* Sky to Navy */
    
    /* Refined Neutrals */
    --white: #FFFFFF;
    --gray-50: #FAFBFC;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Semantic Colors */
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --info: var(--sky);
    
    /* Typography Scale */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.813rem;   /* 13px */
    --text-base: 0.875rem; /* 14px */
    --text-lg: 1rem;       /* 16px */
    --text-xl: 1.125rem;   /* 18px */
    --text-2xl: 1.25rem;   /* 20px */
    --text-3xl: 1.5rem;    /* 24px */
    --text-4xl: 1.875rem;  /* 30px */
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Spacing Scale */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    
    /* Additional spacing aliases */
    --space-xs: 0.25rem;  /* 4px */
    --space-sm: 0.5rem;   /* 8px */
    --space-md: 1rem;     /* 16px */
    --space-lg: 1.5rem;   /* 24px */
    --space-xl: 2rem;     /* 32px */
    --space-2xl: 3rem;    /* 48px */
    --space-section: 4rem; /* 64px */
    
    /* Refined Shadows */
    --shadow-sm: 0 1px 2px rgba(11, 31, 65, 0.04);
    --shadow: 0 1px 3px rgba(11, 31, 65, 0.06), 0 1px 2px rgba(11, 31, 65, 0.04);
    --shadow-md: 0 4px 6px rgba(11, 31, 65, 0.07), 0 2px 4px rgba(11, 31, 65, 0.04);
    --shadow-lg: 0 10px 15px rgba(11, 31, 65, 0.08), 0 4px 6px rgba(11, 31, 65, 0.05);
    --shadow-xl: 0 20px 25px rgba(11, 31, 65, 0.08), 0 10px 10px rgba(11, 31, 65, 0.04);
    --shadow-focus: 0 0 0 3px rgba(96, 163, 217, 0.1);
    
    /* Border Radius */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Additional Variables */
    --border: #E5E7EB; /* gray-200 */
    --text-secondary: #6B7280; /* gray-500 */
    --text-muted: #9CA3AF; /* gray-400 */
    --max-width: 1280px;
    --shadow-2xl: 0 25px 50px -12px rgba(11, 31, 65, 0.15);
}

/* ========================================
   Base Styles
   ======================================== */
html {
    height: 100%;
    overflow-y: scroll; /* Always show vertical scrollbar to prevent horizontal layout shifts */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--text-base);
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    color: var(--gray-700);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Subtle Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(96, 163, 217, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 217, 64, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    color: var(--navy);
    line-height: 1.2;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-3);
}

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

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

/* ========================================
   Header Component
   ======================================== */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-5);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: var(--navy);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: var(--font-bold);
    font-size: var(--text-base);
    box-shadow: var(--shadow);
}

.logo-text {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--navy);
    letter-spacing: -0.01em;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
    display: flex;
    gap: var(--space-6);
}

.nav-link {
    color: var(--gray-500);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: color var(--transition-fast);
    position: relative;
    padding: var(--space-2) 0;
}

.nav-link:hover {
    color: var(--navy);
}

.nav-link.active {
    color: var(--navy);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--sky);
}

/* ========================================
   Main Layout
   ======================================== */
.main, .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-5);
    position: relative;
    z-index: 2;
}

/* ========================================
   Cards & Containers
   ======================================== */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

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

.card-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--navy);
}

.card-body {
    padding: var(--space-5);
}

/* ========================================
   Metric Cards
   ======================================== */
.metrics-row, .stats-row, .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.metric-card, .stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity var(--transition);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card:hover {
    transform: translateY(-1px);
    border-color: var(--sky);
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--sky);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.metric-card:hover::after {
    transform: scaleX(1);
}

.metric-label, .stat-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: var(--space-2);
}

.metric-value, .stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--navy);
    line-height: 1;
    margin-bottom: var(--space-3);
}

.metric-change, .stat-change, .stat-trend {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.metric-change.up, .stat-change.positive {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.metric-change.down, .stat-change.negative {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #4A8BC2;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-lg);
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--gray-700);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: var(--shadow-focus);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* ========================================
   Tables
   ======================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table td {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

/* ========================================
   Status Badges
   ======================================== */
.status-badge,
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-success,
.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.status-warning,
.badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
}

.status-danger,
.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.status-info,
.badge-info {
    background: rgba(96, 163, 217, 0.1);
    color: var(--sky);
}

/* ========================================
   Tooltips
   ======================================== */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: var(--white);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.tooltip:hover::after {
    opacity: 1;
}

/* ========================================
   Progress Bars
   ======================================== */
.progress-track {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--sky);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ========================================
   Modals
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: var(--space-10);
    overflow-y: auto;
}

.modal.active,
.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--navy);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    padding: var(--space-5);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-navy { color: var(--navy); }
.text-sky { color: var(--sky); }
.text-gray { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.bg-white { background: var(--white); }
.bg-gray { background: var(--gray-50); }
.bg-navy { background: var(--navy); }
.bg-sky { background: var(--sky); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .metrics-row,
    .stats-row,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav {
        display: none;
    }
    
    .container,
    .main {
        padding: var(--space-4) var(--space-3);
    }
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-50);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ========================================
   Animation Classes
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-pulse {
    animation: subtle-pulse 2s infinite;
}
