/* Unified Design System 3.0 - Modern, Light, & Clean */
:root {
    /* --- Modern Color Palette (Slate-based) --- */
    /* Light Theme Base */
    --color-bg-body: #f8fafc;       /* Slate 50 */
    --color-bg-card: #ffffff;       /* White */
    --color-bg-subtle: #f1f5f9;     /* Slate 100 */
    --color-bg-hover: #e2e8f0;      /* Slate 200 */
    
    --color-text-main: #0f172a;     /* Slate 900 */
    --color-text-secondary: #475569; /* Slate 600 */
    --color-text-muted: #94a3b8;    /* Slate 400 */
    
    --color-border: #e2e8f0;        /* Slate 200 */
    --color-border-hover: #cbd5e1;  /* Slate 300 */

    /* Brand Colors (Blue) */
    --color-primary: #3b82f6;       /* Blue 500 */
    --color-primary-hover: #2563eb; /* Blue 600 */
    --color-primary-light: #eff6ff; /* Blue 50 */
    --color-primary-text: #ffffff;  /* White text on primary */

    /* Semantic Colors */
    --color-success: #10b981;       /* Emerald 500 */
    --color-success-bg: #ecfdf5;    /* Emerald 50 */
    --color-warning: #f59e0b;       /* Amber 500 */
    --color-warning-bg: #fffbeb;    /* Amber 50 */
    --color-danger: #ef4444;        /* Red 500 */
    --color-danger-bg: #fef2f2;     /* Red 50 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Layout */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Legacy Mapping (for properties.css compatibility) */
    --primary-color: var(--color-primary);
    --secondary-color: var(--color-text-secondary);
    --light-color: var(--color-bg-subtle);
    --border-radius: var(--radius-md);
    --border-radius-lg: var(--radius-lg);
}

[data-theme="dark"] {
    /* Dark Theme Base */
    --color-bg-body: #0f172a;       /* Slate 900 */
    --color-bg-card: #1e293b;       /* Slate 800 */
    --color-bg-subtle: #334155;     /* Slate 700 */
    --color-bg-hover: #475569;      /* Slate 600 */
    
    --color-text-main: #f8fafc;     /* Slate 50 */
    --color-text-secondary: #cbd5e1; /* Slate 300 */
    --color-text-muted: #94a3b8;    /* Slate 400 */
    
    --color-border: #334155;        /* Slate 700 */
    --color-border-hover: #475569;  /* Slate 600 */

    /* Brand Colors (Adjusted for Dark) */
    --color-primary: #60a5fa;       /* Blue 400 */
    --color-primary-hover: #3b82f6; /* Blue 500 */
    --color-primary-light: rgba(59, 130, 246, 0.15); 
    --color-primary-text: #ffffff;

    /* Semantic Colors (Adjusted for Dark) */
    --color-success: #34d399;       /* Emerald 400 */
    --color-success-bg: rgba(16, 185, 129, 0.15);
    --color-warning: #fbbf24;       /* Amber 400 */
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-danger: #f87171;        /* Red 400 */
    --color-danger-bg: rgba(239, 68, 68, 0.15);
    
    --shadow-sm: none;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

/* --- Reset & Base --- */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-hover); }

/* --- Layout Wrappers --- */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.main-content { flex: 1; padding: 2rem 0; }

/* --- Header & Nav --- */
.header-minimal {
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.header-minimal-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem; /* 64px */
}
.nav-minimal {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.nav-item:hover {
    background-color: var(--color-bg-subtle);
    color: var(--color-text-main);
}
.nav-item.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}
.nav-text { display: inline-block; }
@media (max-width: 768px) {
    .nav-text { display: none; }
    .nav-item { padding: 0.5rem; }
}

/* --- Cards --- */
.card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}
.card:hover {
    border-color: var(--color-border-hover);
}
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    gap: 0.5rem;
}
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-primary-text);
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}
.btn-outline {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}
.btn-outline:hover {
    border-color: var(--color-text-secondary);
    background-color: var(--color-bg-subtle);
    color: var(--color-text-main);
}

/* --- Tables --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
}
.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover {
    background-color: var(--color-bg-subtle);
}

/* --- Inputs --- */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text-main);
    background-color: var(--color-bg-card);
    background-clip: padding-box;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus {
    border-color: var(--color-primary);
    outline: 0;
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* --- Utilities (Tailwind-like) --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.border { border: 1px solid var(--color-border); }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* Typography Utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-light { font-weight: 300; }

/* Colors Utilities */
.text-gray-500 { color: var(--color-text-secondary); }
.text-gray-700 { color: var(--color-text-main); }
.text-blue-600 { color: var(--color-primary); }
.text-green-600 { color: var(--color-success); }
.bg-gray-50 { background-color: var(--color-bg-subtle); }
.bg-gray-100 { background-color: var(--color-bg-hover); }
.bg-blue-50 { background-color: var(--color-primary-light); }
.bg-green-50 { background-color: var(--color-success-bg); }

/* --- Theme Toggle --- */
.theme-toggle,
.theme-toggle-btn {
    background: var(--card-bg, var(--color-bg-card));
    border: 1px solid var(--border-color, var(--color-border));
    color: var(--text-secondary, var(--color-text-secondary));
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.theme-toggle:hover,
.theme-toggle-btn:hover {
    background-color: var(--bg-subtle, var(--color-bg-subtle));
    color: var(--text-main, var(--color-text-main));
    border-color: var(--border-color, var(--color-border));
}
.theme-icon {
    font-size: 18px;
    line-height: 1;
}

/* Footer */
.footer {
    background-color: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    margin-top: auto;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
@media (max-width: 640px) {
    .footer-content { flex-direction: column; gap: 0.5rem; }
}

/* --- Compatibility Overrides for Properties.css --- */
/* Overrides removed to allow specific page styles to take precedence */
