/* 
 * Hospital Management System - Main Stylesheet
 * Diamed London Clinic
 * 
 * Color Palette:
 * - Primary Navy: #070c87
 * - Primary Red: #d20000
 * - Secondary Gold: #f59e0b
 * - Background: #f8fafc
 */

/* ============ CSS Variables ============ */
:root {
    /* Colors */
    --color-primary: #070c87;
    --color-primary-light: #1a2599;
    --color-primary-dark: #050a6b;
    --color-secondary: #d20000;
    --color-secondary-light: #e53333;
    --color-accent: #d20000;
    --color-accent-light: #e53333;

    /* Neutrals */
    --color-white: #ffffff;
    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;

    /* Status Colors */
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-error: #ef4444;
    --color-error-light: #fee2e2;
    --color-info: #3b82f6;
    --color-info-light: #dbeafe;

    /* Typography */
    --font-display: 'Poppins', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, sans-serif;

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 70px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-gray-700);
    background-color: var(--color-gray-50);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-gray-900);
    line-height: 1.3;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ============ Loading Spinner ============ */
.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.small {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
}

.loading-spinner.large {
    width: 4rem;
    height: 4rem;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#loading-overlay .loading-spinner {
    width: 3rem;
    height: 3rem;
}

#loading-overlay .loading-message {
    margin-top: 1rem;
    color: var(--color-gray-600);
    font-weight: 500;
}

/* Button Loading State */
.btn .animate-spin {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

/* ============ Utilities ============ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

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

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(7, 12, 135, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(7, 12, 135, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(210, 0, 0, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(210, 0, 0, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(210, 0, 0, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-ghost {
    background: transparent;
    color: var(--color-gray-600);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-gray-100);
    color: var(--color-gray-900);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #34d399 100%);
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-error) 0%, #f87171 100%);
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ============ Forms ============ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-gray-700);
}

.form-label.required::after {
    content: '*';
    color: var(--color-error);
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--color-gray-900);
    background-color: var(--color-white);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(7, 12, 135, 0.1);
}

.form-input::placeholder {
    color: var(--color-gray-400);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-error);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-error);
}

.form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-gray-500);
}

/* Input with icon */
.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 2.75rem;
}

.input-group-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-gray-400);
    pointer-events: none;
}

.input-group .form-input:focus+.input-group-icon,
.input-group .form-input:focus~.input-group-icon {
    color: var(--color-primary);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray-400);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--color-gray-600);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.9375rem;
    color: var(--color-gray-600);
    cursor: pointer;
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-card {
    flex: 1;
    min-width: 140px;
}

.radio-card input {
    display: none;
}

.radio-card-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.radio-card input:checked+.radio-card-label {
    border-color: var(--color-primary);
    background-color: rgba(7, 12, 135, 0.05);
}

.radio-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border-radius: var(--radius-full);
    color: var(--color-gray-500);
    transition: all var(--transition);
}

.radio-card input:checked+.radio-card-label .radio-card-icon {
    background: var(--color-primary);
    color: var(--color-white);
}

.radio-card-title {
    font-weight: 600;
    color: var(--color-gray-700);
    font-size: 0.9375rem;
}

/* ============ Cards ============ */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-gray-100);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-gray-100);
}

/* Status Card */
.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition);
}

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

.stat-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(7, 12, 135, 0.1);
    color: var(--color-primary);
}

.stat-icon.secondary {
    background: rgba(210, 0, 0, 0.1);
    color: var(--color-secondary);
}

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

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

.stat-content {
    flex: 1;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

/* ============ Auth Layout ============ */
.auth-layout {
    min-height: 100vh;
    display: flex;
}

.auth-sidebar {
    width: 45%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.auth-sidebar::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(210, 0, 0, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.auth-sidebar-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--color-white);
    max-width: 400px;
}

.auth-logo {
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 60px;
    width: auto;
}

.auth-logo-text {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-white);
}

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

.auth-sidebar-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-white);
}

.auth-sidebar-text {
    font-size: 1.0625rem;
    opacity: 0.9;
    line-height: 1.7;
}

.auth-sidebar-features {
    margin-top: 2.5rem;
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.auth-feature-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    overflow-y: auto;
}

.auth-form-container {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--color-gray-500);
    margin-bottom: 2rem;
}

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

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-gray-400);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-gray-200);
}

.auth-footer {
    text-align: center;
    color: var(--color-gray-500);
    font-size: 0.9375rem;
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 600;
}

/* ============ Dashboard Layout ============ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.sidebar-logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

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

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.15);
    border-right: 3px solid var(--color-accent);
}

.nav-item-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.nav-item-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-secondary);
    color: var(--color-white);
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

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

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: capitalize;
}

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

/* Header */
.header {
    height: var(--header-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-gray-600);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    background: var(--color-gray-50);
    transition: all var(--transition);
}

.header-search input:focus {
    background: var(--color-white);
    border-color: var(--color-primary);
    outline: none;
    width: 320px;
}

.header-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--color-gray-400);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-action-btn {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: all var(--transition);
}

.header-action-btn:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
}

.header-action-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    background: var(--color-secondary);
    color: var(--color-white);
    border-radius: var(--radius-full);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem;
    padding-right: 1rem;
    background: var(--color-gray-100);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
}

.header-user:hover {
    background: var(--color-gray-200);
}

.header-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.header-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-gray-700);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* ============ Tables ============ */
.table-container {
    overflow-x: auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.25rem;
    text-align: left;
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
}

.table td {
    font-size: 0.9375rem;
    color: var(--color-gray-700);
    border-bottom: 1px solid var(--color-gray-100);
}

.table tbody tr:hover {
    background: var(--color-gray-50);
}

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

/* ============ Badges ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(7, 12, 135, 0.1);
    color: var(--color-primary);
}

.badge-secondary {
    background: rgba(210, 0, 0, 0.1);
    color: var(--color-secondary);
}

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

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

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

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

/* ============ Toast Notifications ============ */
.toast-notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform var(--transition-slow);
    max-width: 400px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--color-gray-700);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray-400);
    padding: 0;
}

.toast-close:hover {
    color: var(--color-gray-600);
}

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

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

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

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

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

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

.toast-info {
    border-left: 4px solid var(--color-info);
}

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

/* ============ Loading Overlay ============ */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-message {
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--color-gray-600);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ Animations ============ */
.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.3s ease forwards;
}

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

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

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .menu-toggle {
        display: flex;
    }

    .header-search input {
        width: 200px;
    }

    .header-search input:focus {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .auth-layout {
        flex-direction: column;
    }

    .auth-sidebar {
        width: 100%;
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .auth-sidebar-title {
        font-size: 1.5rem;
    }

    .auth-sidebar-features {
        display: none;
    }

    .auth-main {
        padding: 2rem 1.5rem;
    }

    .header-search {
        display: none;
    }

    .header-user-name {
        display: none;
    }

    .radio-group {
        flex-direction: column;
    }

    .radio-card {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 1rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .table th,
    .table td {
        padding: 0.75rem;
    }
}