/* /assets/css/style.css */

:root {
    /* Modern SaaS Colors */
    --primary-color: #1e40af; /* Deep Blue */
    --primary-hover: #1e3a8a;
    --secondary-color: #0f172a; /* Slate 900 */
    --bg-color: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    
    /* Text */
    --text-main: #334155; /* Slate 700 */
    --text-muted: #64748b; /* Slate 500 */
    
    /* Borders & UI */
    --border-color: #e2e8f0; /* Slate 200 */
    --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), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Semantic Actions */
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --success-border: #10b981;

    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --danger-border: #ef4444;

    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --warning-border: #f59e0b;

    --neutral-bg: #f1f5f9;
    --neutral-text: #475569;
    --neutral-border: #94a3b8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

h1 { font-size: 1.875rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

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

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (Desktop Admin) */
.sidebar {
    width: 260px;
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 40;
}

.sidebar h2 {
    color: #f8fafc;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    padding-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.sidebar-nav {
    list-style: none;
    flex-grow: 1;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    color: #94a3b8;
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

.sidebar-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    width: 100%;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    font-weight: 500;
    color: var(--text-muted);
    background: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.filter-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    color: var(--text-muted);
}
.empty-state svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    border: 1px solid transparent;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(30, 64, 175, 0.5);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(30, 64, 175, 0.3);
    color: #fff;
    text-decoration: none;
}

.btn-success {
    color: #fff;
    background-color: var(--success-border);
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.5);
}
.btn-success:hover {
    background-color: #059669;
    color: #fff;
}

.btn-danger {
    color: #fff;
    background-color: var(--danger-border);
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.5);
}
.btn-danger:hover {
    background-color: #dc2626;
    color: #fff;
}

.btn-warning {
    color: #fff;
    background-color: var(--warning-border);
}
.btn-warning:hover {
    background-color: #d97706;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.btn-xl {
    padding: 1.25rem 2rem;
    font-size: 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled, .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success { background-color: var(--success-bg); color: var(--success-text); border: 1px solid #a7f3d0; }
.badge-danger { background-color: var(--danger-bg); color: var(--danger-text); border: 1px solid #fecaca; }
.badge-warning { background-color: var(--warning-bg); color: var(--warning-text); border: 1px solid #fde68a; }
.badge-neutral { background-color: var(--neutral-bg); color: var(--neutral-text); border: 1px solid var(--border-color); }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}
.form-control, input[type="email"], input[type="password"], input[type="text"], input[type="date"], select, textarea {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--secondary-color);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 0.5rem;
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}
tr:last-child td {
    border-bottom: none;
}
tbody tr {
    transition: background-color 0.15s;
}
tbody tr:hover {
    background-color: #f8fafc;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.alert-danger {
    color: var(--danger-text);
    background-color: var(--danger-bg);
    border: 1px solid #fecaca;
}
.alert-success {
    color: var(--success-text);
    background-color: var(--success-bg);
    border: 1px solid #a7f3d0;
}
.alert-warning {
    color: var(--warning-text);
    background-color: var(--warning-bg);
    border: 1px solid #fde68a;
}

/* Login Split Screen */
.login-body {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-color);
}
.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #ffffff;
}
.login-right {
    flex: 1;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 4rem;
}
.login-card {
    width: 100%;
    max-width: 420px;
}
.login-header h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}
.login-header p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Utils */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger-border); }
.text-success { color: var(--success-border); }


/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    /* Admin Sidebar turns into horizontal scroll or simple block on mobile */
    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .sidebar h2 {
        margin-bottom: 0;
        margin-right: 1rem;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
    }
    .sidebar-nav li {
        margin-bottom: 0;
        flex: 1 1 auto;
    }
    .sidebar-nav a {
        text-align: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    .card {
        padding: 1.25rem;
    }
    
    /* Grid adjustments */
    .filter-grid, [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Login */
    .login-body {
        flex-direction: column-reverse;
    }
    .login-right {
        padding: 2rem 1rem;
        text-align: center;
    }
    
    /* Table Responsive for small screens - force horizontal scroll if needed */
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
}
