/* lolnoi Property Management System - Professional Design System v2 */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Design Tokens */
:root {
    /* Colors - Monochromatic with single accent */
    --black: #000000;
    --gray-950: #0a0a0a;
    --gray-900: #171717;
    --gray-800: #262626;
    --gray-700: #404040;
    --gray-600: #525252;
    --gray-500: #737373;
    --gray-400: #a3a3a3;
    --gray-300: #d4d4d4;
    --gray-200: #e5e5e5;
    --gray-100: #f5f5f5;
    --gray-50: #fafafa;
    --white: #ffffff;
    
    /* Accent - Professional blue */
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --accent-light: #e6f0ff;
    
    /* Legacy variables for compatibility */
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    
    /* Semantic colors */
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    
    /* Typography Scale */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.5rem;     /* 24px */
    --text-2xl: 2rem;      /* 32px */
    
    /* Spacing Scale - Reduced by 50% for density */
    --space-1: 0.125rem;   /* 2px */
    --space-2: 0.25rem;    /* 4px */
    --space-3: 0.375rem;   /* 6px */
    --space-4: 0.5rem;     /* 8px */
    --space-6: 0.75rem;    /* 12px */
    --space-8: 1rem;       /* 16px */
    --space-12: 1.5rem;    /* 24px */
    
    /* Layout */
    --max-width: 95%;
    --sidebar-width: 240px;
    
    /* Effects */
    --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);
    
    /* Transitions */
    --transition: all 0.15s ease;
}

/* Base Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--black);
}

h1 { font-size: var(--text-2xl); margin-bottom: var(--space-6); }
h2 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
h4 { font-size: var(--text-base); margin-bottom: var(--space-2); }

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

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

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

/* Layout Components */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Header */
header {
    background: var(--gray-900);
    border-bottom: 1px solid var(--gray-800);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: var(--space-8);
}

.header-left h1 {
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0;
}

.header-left h1 a {
    color: var(--white);
}


/* User Info */
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--gray-300);
}

.user-info a {
    color: var(--gray-300);
}

.user-info a:hover {
    color: var(--white);
}

/* Main Content */
main {
    min-height: calc(100vh - 64px);
    background: var(--gray-50);
}

#content {
    padding: var(--space-8) 0;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--white);
    padding: var(--space-3) var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.breadcrumb a {
    color: var(--gray-600);
}

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

.breadcrumb span {
    margin: 0 var(--space-2);
}

.breadcrumb .current {
    color: var(--gray-900);
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

/* Tables */
table {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: var(--gray-50);
}

th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

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

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

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--gray-500);
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-1);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-base);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

button:hover,
.button:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

button[type="submit"],
.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

button[type="submit"]:hover,
.button-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: var(--space-6);
}

.stat-card h3 {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: var(--space-4);
    border-radius: 4px;
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    position: relative;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: 4px;
}

.badge-success {
    background: var(--success);
    color: var(--white);
}

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

.badge-warning {
    background: var(--warning);
    color: var(--white);
}

/* Utility Classes */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }


/* HTMX Loading Indicator */
.htmx-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: var(--white);
    padding: var(--space-2) var(--space-4);
    border-radius: 4px;
    font-size: var(--text-sm);
    display: none;
}

.htmx-request .htmx-indicator {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Layout */
.main-layout {
    display: flex;
    min-height: calc(100vh - 64px - 49px); /* header height - breadcrumb height */
}

.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: var(--space-6) 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: var(--space-8);
    padding: 0 var(--space-4);
}

.sidebar-section h4 {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    margin-bottom: var(--space-3);
}

.sidebar a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--gray-700);
    font-size: var(--text-sm);
    border-radius: 4px;
    transition: var(--transition);
    margin-bottom: var(--space-1);
}

.sidebar a:hover {
    background: var(--gray-50);
    color: var(--accent);
}

.sidebar a.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.content-area {
    flex: 1;
    padding: var(--space-6);
    overflow-y: auto;
}

/* Mobile Sidebar */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        padding: var(--space-4) 0;
        order: 2;
    }
    
    .content-area {
        order: 1;
    }
}

/* Print Styles */
@media print {
    header, .breadcrumb, .quick-actions, button, .sidebar {
        display: none;
    }
    
    main {
        background: white;
    }
    
    table {
        border: 1px solid #000;
    }
}