/* ===== DOU Kampüs Design System ===== */

/* --- CSS Custom Properties --- */
:root {
    /* Primary Colors */
    --color-bg-primary: #0a1628;
    --color-bg-secondary: #111d35;
    --color-bg-tertiary: #162040;
    --color-bg-card: rgba(22, 32, 64, 0.6);
    --color-bg-card-solid: #162040;
    --color-bg-sidebar: rgba(10, 22, 40, 0.95);
    --color-bg-input: rgba(255, 255, 255, 0.05);
    --color-bg-hover: rgba(255, 255, 255, 0.08);

    /* Accent Colors - Doğuş Üniversitesi Kırmızısı */
    --color-accent: #BE1E2D;
    --color-accent-light: #dc3545;
    --color-accent-dark: #9a1824;
    --color-accent-glow: rgba(190, 30, 45, 0.3);

    /* Text Colors */
    --color-text-primary: #f0f0f5;
    --color-text-secondary: #a0a8c0;
    --color-text-muted: #6b7394;
    --color-text-inverse: #0a1628;

    /* Status Colors */
    --color-success: #34d399;
    --color-success-bg: rgba(52, 211, 153, 0.15);
    --color-warning: #fbbf24;
    --color-warning-bg: rgba(251, 191, 36, 0.15);
    --color-error: #f87171;
    --color-error-bg: rgba(248, 113, 113, 0.15);
    --color-info: #60a5fa;
    --color-info-bg: rgba(96, 165, 250, 0.15);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --border-color-accent: rgba(190, 30, 45, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(190, 30, 45, 0.2);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 72px;
    --navbar-height: 64px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Glassmorphism */
    --glass-bg: rgba(22, 32, 64, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(16px);
}

/* --- Light Theme --- */
[data-theme="light"] {
    /* Primary Colors */
    --color-bg-primary: #f0f2f5;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #e8ecf1;
    --color-bg-card: rgba(255, 255, 255, 0.85);
    --color-bg-card-solid: #ffffff;
    --color-bg-sidebar: rgba(255, 255, 255, 0.97);
    --color-bg-input: rgba(0, 0, 0, 0.03);
    --color-bg-hover: rgba(0, 0, 0, 0.05);

    /* Accent Colors - Doğuş Üniversitesi Kırmızısı */
    --color-accent: #BE1E2D;
    --color-accent-light: #dc3545;
    --color-accent-dark: #9a1824;
    --color-accent-glow: rgba(190, 30, 45, 0.25);

    /* Text Colors */
    --color-text-primary: #1a1e2e;
    --color-text-secondary: #4a5068;
    --color-text-muted: #8892a8;
    --color-text-inverse: #ffffff;

    /* Status Colors */
    --color-success: #16a34a;
    --color-success-bg: rgba(22, 163, 74, 0.1);
    --color-warning: #d97706;
    --color-warning-bg: rgba(217, 119, 6, 0.1);
    --color-error: #dc2626;
    --color-error-bg: rgba(220, 38, 38, 0.1);
    --color-info: #2563eb;
    --color-info-bg: rgba(37, 99, 235, 0.1);

    /* Borders */
    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-hover: rgba(0, 0, 0, 0.2);
    --border-color-accent: rgba(190, 30, 45, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(190, 30, 45, 0.15);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-blur: blur(16px);
}

/* Theme transition */
body,
body *,
.sidebar,
.navbar,
.card,
.stat-card,
.modal,
.toast,
.form-input,
.form-select,
.btn,
.badge,
.tag,
.data-table,
.login-page,
.login-card {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Theme Toggle --- */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-base);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--color-bg-hover);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.theme-toggle .theme-icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: inline-block;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: inline-block;
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

/* Light theme specific overrides */
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .sidebar-link.active {
    background: rgba(184, 145, 47, 0.1);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

img {
    max-width: 100%;
    display: block;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Layout --- */
#app {
    min-height: 100vh;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-base);
}

.page-content {
    flex: 1;
    padding: var(--space-xl);
    padding-top: calc(var(--navbar-height) + var(--space-xl));
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: all var(--transition-base);
    backdrop-filter: var(--glass-blur);
}

.sidebar-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-height: var(--navbar-height);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--color-text-primary);
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) 0;
}

.sidebar-section {
    padding: var(--space-sm) var(--space-lg);
    margin-top: var(--space-md);
}

.sidebar-section-title {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    color: var(--color-text-secondary);
    border-radius: 0;
    transition: all var(--transition-fast);
    cursor: pointer;
    font-size: var(--text-sm);
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.sidebar-link.active {
    background: rgba(212, 168, 83, 0.08);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: var(--text-base);
}

.sidebar-link .badge {
    margin-left: auto;
    background: var(--color-accent);
    color: var(--color-text-inverse);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--color-bg-hover);
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-accent), #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 90;
    transition: left var(--transition-base);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.navbar-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
}

.navbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.navbar-breadcrumb span {
    color: var(--color-text-secondary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.navbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-base);
    position: relative;
}

.navbar-icon-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
    border-color: var(--border-color-hover);
}

.navbar-icon-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--color-error);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: var(--text-xl);
    cursor: pointer;
    padding: var(--space-sm);
}

/* --- Cards --- */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.card-body {
    color: var(--color-text-secondary);
}

.card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

/* Stat Cards */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    transition: all var(--transition-base);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.stat-icon.blue {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.stat-icon.green {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.stat-icon.amber {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.stat-icon.red {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.stat-icon.gold {
    background: rgba(212, 168, 83, 0.15);
    color: var(--color-accent);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.stat-change {
    font-size: var(--text-xs);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stat-change.up {
    color: var(--color-success);
}

.stat-change.down {
    color: var(--color-error);
}

/* --- Grid System --- */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table thead {
    background: var(--color-bg-tertiary);
}

.data-table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    color: var(--color-text-secondary);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--color-bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-text-inverse);
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(212, 168, 83, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--color-bg-hover);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--text-xs);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--text-base);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-group {
    display: flex;
    gap: var(--space-sm);
}

/* --- Forms --- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

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

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7394' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-error);
    margin-top: var(--space-xs);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.4;
}

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

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

.badge-error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge-gold {
    background: rgba(212, 168, 83, 0.15);
    color: var(--color-accent);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-color);
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--color-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 300px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease forwards;
    border-left: 4px solid var(--color-info);
}

.toast.success {
    border-left-color: var(--color-success);
}

.toast.warning {
    border-left-color: var(--color-warning);
}

.toast.error {
    border-left-color: var(--color-error);
}

.toast-icon {
    font-size: var(--text-lg);
}

.toast.success .toast-icon {
    color: var(--color-success);
}

.toast.warning .toast-icon {
    color: var(--color-warning);
}

.toast.error .toast-icon {
    color: var(--color-error);
}

.toast .toast-icon {
    color: var(--color-info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: var(--text-sm);
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* --- Page Header --- */
.page-header {
    margin-bottom: var(--space-xl);
}

.page-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.page-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* --- Search --- */
.search-box {
    position: relative;
    max-width: 320px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.search-box .form-input {
    padding-left: 40px;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-xl);
}

.tab {
    padding: var(--space-md) var(--space-lg);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-body);
}

.tab:hover {
    color: var(--color-text-primary);
}

.tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* --- Tags --- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--text-xs);
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    border: 1px solid var(--border-color);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: var(--space-lg);
    opacity: 0.4;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
    color: var(--color-text-secondary);
}

.empty-state p {
    font-size: var(--text-sm);
    max-width: 400px;
    margin: 0 auto;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade {
    animation: fadeIn 0.4s ease;
}

.animate-slide-up {
    animation: slideUp 0.5s ease;
}

.animate-slide-in {
    animation: slideIn 0.4s ease;
}

/* Staggered animations */
.stagger>* {
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
}

.stagger>*:nth-child(1) {
    animation-delay: 0s;
}

.stagger>*:nth-child(2) {
    animation-delay: 0.05s;
}

.stagger>*:nth-child(3) {
    animation-delay: 0.1s;
}

.stagger>*:nth-child(4) {
    animation-delay: 0.15s;
}

.stagger>*:nth-child(5) {
    animation-delay: 0.2s;
}

.stagger>*:nth-child(6) {
    animation-delay: 0.25s;
}

.stagger>*:nth-child(7) {
    animation-delay: 0.3s;
}

.stagger>*:nth-child(8) {
    animation-delay: 0.35s;
}

/* --- Toggle Switch --- */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle input:checked+.toggle-slider {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: var(--space-xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-lg);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-xl) + 4px);
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    border: 2px solid var(--color-bg-primary);
}

.timeline-item-time {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.timeline-item-content {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* --- Utility Classes --- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-accent {
    color: var(--color-accent);
}

.text-success {
    color: var(--color-success);
}

.text-error {
    color: var(--color-error);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.font-display {
    font-family: var(--font-display);
}

.font-bold {
    font-weight: 700;
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .navbar {
        left: 0;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    :root {
        --space-xl: 1.25rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-title {
        font-size: var(--text-base);
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: var(--text-xl);
    }

    .stat-card {
        padding: var(--space-lg);
    }
}