/* 
 * Premium Design System - LaDigits Office Pro
 * Monochromatic & Emerald Jade Palette
 */

:root {
    /* New Professional Palette: Slate & Steel */
    --primary: #334155;
    /* Slate 700 */
    --primary-dark: #1e293b;
    /* Slate 800 */
    --primary-light: #f1f5f9;
    /* Slate 100 */
    --accent: #6366f1;
    /* Indigo 500 - Sophisticated accent */

    --bg-main: #f8fafc;
    /* Professional Gray-White */
    --bg-sidebar: #0f172a;
    /* Deep Slate - Premium Dark Sidebar */
    --card-bg: #ffffff;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #ffffff;

    --border-color: #e2e8f0;

    /* Shadows - More subtle and professional */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Animation */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --bg-sidebar: #020617;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    transition: var(--transition);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom Card */
.premium-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: var(--transition);
}

.premium-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Button Premium Styles */
.btn-premium {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    /* Slightly sharper corner for professional look */
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-premium:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
    transform: translateY(-1px);
}

.icon-btn-sm {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn-sm:hover {
    background: var(--primary);
    color: white;
}

/* Global Layout */
.main-content {
    margin-left: 280px;
    /* Matches sidebar width */
    padding: 2.5rem;
    min-height: 100vh;
    transition: var(--transition);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Table Styles - Shared across modules */
.premium-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.premium-table th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.premium-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.premium-table tr:last-child td {
    border-bottom: none;
}

.premium-table tr:hover {
    background: #fdfdfd;
}

/* Utility Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.badge-success {
    background: #ecfdf5;
    color: #059669;
}

/* --- PREMIUM MODAL SYSTEM --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    /* Deep Slate Overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex !important;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- ADVANCED FORM STYLING --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #94a3b8;
}

/* Form Layout Grids */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Alert Overlay Fix */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #d1fae5;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0 !important;
        padding: 1.5rem;
    }
}