:root {
    /* Color Palette - Minimalist & Modern */
    --primary: #4f46e5;       /* Indigo 600 */
    --primary-soft: #eef2ff;  /* Indigo 50 */
    --primary-hover: #4338ca; /* Indigo 700 */
    
    --success: #10b981;
    --success-soft: #ecfdf5;
    
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    
    /* Backgrounds */
    --bg-body: #fafafa;       /* Almost white */
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    
    /* Text */
    --text-main: #18181b;     /* Zinc 900 */
    --text-secondary: #71717a; /* Zinc 500 */
    --text-tertiary: #a1a1aa;  /* Zinc 400 */
    
    /* Borders & Dividers */
    --border-color: #e4e4e7;  /* Zinc 200 */
    --border-light: #f4f4f5;  /* Zinc 100 */
    
    /* Dimensions */
    --sidebar-width: 280px;
    --radius: 12px;
    --radius-sm: 8px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    font-size: 14px; /* Base font size slightly smaller for density */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    box-sizing: border-box;
    transition: transform 0.3s ease;
    z-index: 50;
}

.sidebar h2 {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 2.5rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.025em;
}

.sidebar h2 i {
    color: var(--primary);
    background: var(--primary-soft);
    padding: 8px;
    border-radius: 8px;
    font-size: 1rem;
}

.sidebar a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.85rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar a i {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
    transition: var(--transition);
}

.sidebar a:hover {
    background-color: var(--border-light);
    color: var(--text-main);
}

.sidebar a.active {
    background-color: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.sidebar a.active i {
    color: var(--primary);
}

.sidebar .logout {
    margin-top: auto;
    color: var(--danger);
    border: 1px solid transparent;
}

.sidebar .logout:hover {
    background-color: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.1);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2.5rem 3rem;
    max-width: 1600px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    border-bottom: 1px solid transparent; /* Placeholder for sticky header border */
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.03em;
}

/* --- Components --- */

/* Cards */
.card {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    border-color: #d4d4d8; /* Zinc 300 */
    box-shadow: var(--shadow-sm);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: var(--bg-body); }

td img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background-color: var(--text-main); /* Black/Dark Gray for Minimalism */
    color: white;
    border: 1px solid var(--text-main);
}
.btn-primary:hover {
    background-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--text-secondary);
    background-color: var(--bg-body);
}

.btn-success {
    background-color: var(--success-soft);
    color: var(--success);
    border: 1px solid transparent;
}
.btn-success:hover { background-color: #d1fae5; }

.btn-danger {
    background-color: var(--danger-soft);
    color: var(--danger);
}
.btn-danger:hover { background-color: #fee2e2; }

.btn-warning {
    background-color: var(--warning-soft);
    color: #b45309;
}
.btn-warning:hover { background-color: #fef3c7; }

/* Actions (Icon Buttons) */
.actions .btn {
    padding: 0.4rem;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

/* Forms */
.form-layout-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.form-layout-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: var(--text-tertiary);
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-group input::placeholder { color: var(--text-tertiary); }

.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1.5rem;
}

/* Image Preview */
.image-preview-container {
    margin-top: 1rem;
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--bg-body);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.preview-label {
    position: absolute;
    bottom: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: var(--transition);
}

.image-preview-container:hover .preview-label {
    opacity: 1;
}

/* Login */
.login-container {
    background-color: var(--bg-body);
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--bg-surface);
    padding: 3rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 380px;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 1.5rem 0.5rem; align-items: center; }
    .sidebar h2 span { display: none; } /* Hide text in logo */
    .sidebar h2 { margin-left: 0; }
    .sidebar a span { display: none; } /* Hide text in links */
    .sidebar a { justify-content: center; padding: 1rem; width: 40px; height: 40px; }
    .main-content { margin-left: 80px; padding: 2rem; }
    
    .form-layout-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 240px; align-items: flex-start; }
    .sidebar.active { transform: translateX(0); }
    .sidebar a { width: auto; height: auto; justify-content: flex-start; }
    .sidebar a span { display: inline; }
    .sidebar h2 span { display: inline; }
    .main-content { margin-left: 0; padding: 1rem; }
    
    .form-layout-row {
        grid-template-columns: 1fr;
    }
}
