/* ========================================================================
   Reegan Online – Premium Design System
   ======================================================================== */

/* ---- CSS Custom Properties ---- */
:root {
    /* Primary Palette */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Accent */
    --accent-400: #34d399;
    --accent-500: #10b981;
    --accent-600: #059669;

    /* Danger */
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    /* Warning */
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;

    /* Dark Theme Base */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --bg-card-hover: #1f2544;
    --bg-elevated: #232a47;
    --bg-input: #151b30;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #818cf8;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-color-hover: rgba(99, 102, 241, 0.3);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-300);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-700);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-600);
}

/* ========================================================================
   LOGIN PAGE
   ======================================================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-gradient-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: float1 15s ease-in-out infinite;
}

.bg-gradient-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float2 18s ease-in-out infinite;
}

.bg-gradient-3 {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 12s ease-in-out infinite;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-30px, 40px) scale(1.1);
    }

    66% {
        transform: translate(20px, -20px) scale(0.95);
    }
}

@keyframes float2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(1.1);
    }
}

@keyframes float3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Floating Shapes */
.floating-shapes {
    position: absolute;
    inset: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: var(--primary-400);
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 15%;
    left: 10%;
    animation: floatShape 8s ease-in-out infinite;
}

.shape-2 {
    width: 40px;
    height: 40px;
    top: 70%;
    left: 80%;
    animation: floatShape 10s ease-in-out infinite 1s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 40%;
    left: 70%;
    background: var(--accent-400);
    animation: floatShape 12s ease-in-out infinite 2s;
}

.shape-4 {
    width: 30px;
    height: 30px;
    top: 80%;
    left: 20%;
    animation: floatShape 9s ease-in-out infinite 0.5s;
}

.shape-5 {
    width: 50px;
    height: 50px;
    top: 25%;
    left: 60%;
    background: var(--accent-400);
    animation: floatShape 11s ease-in-out infinite 3s;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px;
    width: 100%;
    max-width: 440px;
}

.login-card {
    width: 100%;
    background: rgba(26, 31, 53, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    margin-bottom: 16px;
}

.logo-icon-large {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.logo-icon-large .material-symbols-rounded {
    font-size: 32px;
    color: white;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-accent {
    color: var(--primary-400);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.login-brand {
    text-align: center;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ========================================================================
   FORM ELEMENTS
   ======================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .material-symbols-rounded {
    font-size: 18px;
    color: var(--text-muted);
}

.form-label-sm {
    font-size: 0.78rem;
}

.required-star {
    color: var(--danger-400);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.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 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-wrapper input:checked+.checkbox-custom {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox-wrapper input:checked+.checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.checkbox-label,
.radio-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Radio */
.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 4px;
}

.radio-wrapper input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.radio-wrapper input:checked+.radio-custom {
    border-color: var(--primary-500);
}

.radio-wrapper input:checked+.radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-500);
    border-radius: 50%;
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-wrapper input {
    display: none;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.toggle-thumb {
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all var(--transition-base);
}

.toggle-wrapper input:checked+.toggle-track {
    background: var(--primary-600);
    border-color: var(--primary-500);
}

.toggle-wrapper input:checked+.toggle-track .toggle-thumb {
    background: white;
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ========================================================================
   BUTTONS
   ======================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
}

.btn .material-symbols-rounded {
    font-size: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: white;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-400), var(--danger-500));
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-sm .material-symbols-rounded {
    font-size: 18px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--primary-600);
    color: white;
}

.btn-icon-danger:hover {
    background: var(--danger-600);
    color: white;
}

.action-btns {
    display: flex;
    gap: 6px;
}

/* ========================================================================
   SIDEBAR
   ======================================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-base);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    min-height: 70px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon .material-symbols-rounded {
    font-size: 20px;
    color: white;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color var(--transition-fast);
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

.sidebar-menu {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.menu-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-400);
}

.menu-item.active .material-symbols-rounded {
    color: var(--primary-400);
}

.menu-item .material-symbols-rounded {
    font-size: 22px;
    flex-shrink: 0;
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.menu-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 8px 14px 4px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
}

.user-avatar,
.user-avatar-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--danger-400) !important;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ========================================================================
   MAIN CONTENT
   ======================================================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 70px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.top-bar-actions {
    margin-left: auto;
}

.greeting {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.greeting strong {
    color: var(--text-primary);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.content-area {
    padding: 28px;
    flex: 1;
}

/* ========================================================================
   ALERTS / FLASH MESSAGES
   ======================================================================== */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    margin: 0 28px 0;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--accent-400);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger-400);
}

.alert .material-symbols-rounded {
    font-size: 22px;
    flex-shrink: 0;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    padding: 2px;
}

.alert-close:hover {
    opacity: 1;
}

/* ========================================================================
   CARDS
   ======================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .material-symbols-rounded {
    color: var(--primary-400);
    font-size: 22px;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

.card-body {
    padding: 24px;
}

/* ========================================================================
   STAT CARDS
   ======================================================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-gradient-1 {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.stat-gradient-2 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.04));
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.stat-gradient-3 {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.04));
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-gradient-1 .stat-icon {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-400);
}

.stat-gradient-2 .stat-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-400);
}

.stat-gradient-3 .stat-icon {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.stat-icon .material-symbols-rounded {
    font-size: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================================================
   NAVIGATION TILES
   ======================================================================== */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.tile-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.tile:hover .tile-glow {
    opacity: 1;
}

.tile-1 .tile-glow {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

.tile-2 .tile-glow {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
}

.tile-3 .tile-glow {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
}

.tile-admin .tile-glow {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
}

.tile-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.tile-1 .tile-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
}

.tile-2 .tile-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-400);
}

.tile-3 .tile-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-400);
}

.tile-admin .tile-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.tile-icon .material-symbols-rounded {
    font-size: 26px;
}

.tile-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.tile-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tile-arrow {
    position: absolute;
    bottom: 20px;
    right: 20px;
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--transition-base);
    color: var(--text-muted);
}

.tile:hover .tile-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================================================
   DATA TABLE
   ======================================================================== */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    white-space: nowrap;
}

.data-table th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-center {
    text-align: center !important;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding-top: 20px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

.page-btn.active {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

/* ========================================================================
   BADGES
   ======================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
    border-color: rgba(99, 102, 241, 0.25);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-400);
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-400);
    border-color: rgba(239, 68, 68, 0.25);
}

.badge-secondary {
    background: var(--bg-elevated);
    color: var(--text-muted);
}

/* ========================================================================
   MODALS
   ======================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s ease;
}

.modal-wide {
    max-width: 700px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 .material-symbols-rounded {
    color: var(--primary-400);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ========================================================================
   FORM BUILDER
   ======================================================================== */
.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.form-builder-section {
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.field-builder-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    transition: border-color var(--transition-fast);
}

.field-builder-item:hover {
    border-color: var(--border-color-hover);
}

.field-builder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.field-drag-handle {
    color: var(--text-muted);
    cursor: grab;
}

.field-number {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    flex: 1;
}

.field-builder-body {
    padding: 12px;
}

.field-builder-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: start;
}

.field-options-row {
    margin-top: 10px;
}

.empty-fields-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
    background: var(--bg-elevated);
    border-radius: var(--border-radius-sm);
    border: 1px dashed var(--border-color);
}

/* ========================================================================
   EMPTY & SPECIAL STATES
   ======================================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    color: var(--text-muted);
    opacity: 0.4;
    display: block;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    padding: 32px;
    color: var(--text-muted);
}

.empty-state-inline .material-symbols-rounded {
    font-size: 28px;
    opacity: 0.5;
}

/* Success State */
.success-state {
    text-align: center;
    padding: 60px 20px;
}

.success-animation {
    margin-bottom: 16px;
}

.success-check {
    font-size: 72px;
    color: var(--accent-400);
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-state h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Placeholder / Other Page */
.placeholder-content {
    text-align: center;
    padding: 40px 20px;
}

.placeholder-icon {
    margin-bottom: 16px;
}

.placeholder-icon .material-symbols-rounded {
    font-size: 56px;
    color: var(--warning-400);
    opacity: 0.6;
}

.placeholder-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.placeholder-content>p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.feature-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.feature-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.feature-preview-item:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
}

.feature-preview-item .material-symbols-rounded {
    font-size: 22px;
    color: var(--primary-400);
}

/* CSV Controls */
.csv-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

/* Settings */
.settings-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.settings-section-title .material-symbols-rounded {
    color: var(--primary-400);
}

.setting-row {
    margin-bottom: 16px;
}

/* 404 Page */
.error-page {
    text-align: center;
    z-index: 1;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.error-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========================================================================
   UTILITIES
   ======================================================================== */
.mb-4 {
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.text-muted {
    color: var(--text-muted);
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */
@media (max-width: 1024px) {
    .field-builder-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .content-area {
        padding: 16px;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .alert {
        margin: 0 16px;
    }

    .tiles-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .csv-controls {
        flex-direction: column;
    }

    .field-builder-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 10px;
        max-height: 95vh;
    }

    .modal-wide {
        max-width: 100%;
    }

    .greeting {
        display: none;
    }

    .login-card {
        padding: 28px 20px;
    }

    .success-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.05rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .tile {
        padding: 20px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ========================================================================
   FORM CARDS – Data Entry Dashboard
   ======================================================================== */
.form-cards-header {
    margin-bottom: 24px;
}

.form-cards-header .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.form-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.form-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
}

.form-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.form-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height var(--transition-base);
}

.form-card:hover .form-card-glow {
    height: 6px;
}

/* Color variants */
.form-card-indigo .form-card-glow {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
}

.form-card-emerald .form-card-glow {
    background: linear-gradient(90deg, var(--accent-500), var(--accent-400));
}

.form-card-amber .form-card-glow {
    background: linear-gradient(90deg, var(--warning-500), var(--warning-400));
}

.form-card-violet .form-card-glow {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.form-card-rose .form-card-glow {
    background: linear-gradient(90deg, #f43f5e, #fb7185);
}

.form-card-cyan .form-card-glow {
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
}

.form-card-indigo:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.1);
}

.form-card-emerald:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(16, 185, 129, 0.1);
}

.form-card-amber:hover {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(245, 158, 11, 0.1);
}

.form-card-violet:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.1);
}

.form-card-rose:hover {
    border-color: rgba(244, 63, 94, 0.3);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(244, 63, 94, 0.1);
}

.form-card-cyan:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(6, 182, 212, 0.1);
}

.form-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.form-card-indigo .form-card-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
}

.form-card-emerald .form-card-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-400);
}

.form-card-amber .form-card-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-400);
}

.form-card-violet .form-card-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.form-card-rose .form-card-icon {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
}

.form-card-cyan .form-card-icon {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}

.form-card-icon .material-symbols-rounded {
    font-size: 26px;
}

.form-card-content {
    padding: 24px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.form-card-content .form-card-icon {
    margin-bottom: 12px;
}

.form-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.form-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.form-card-desc-empty {
    color: var(--text-muted);
    font-style: italic;
}

.form-card-meta {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

.form-card-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-card-stat .material-symbols-rounded {
    font-size: 16px;
}

.form-card-action {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 14px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.15);
    transition: all var(--transition-base);
}

.form-card:hover .form-card-action {
    color: var(--text-primary);
}

.form-card-indigo:hover .form-card-action {
    color: var(--primary-400);
    background: rgba(99, 102, 241, 0.08);
}

.form-card-emerald:hover .form-card-action {
    color: var(--accent-400);
    background: rgba(16, 185, 129, 0.08);
}

.form-card-amber:hover .form-card-action {
    color: var(--warning-400);
    background: rgba(245, 158, 11, 0.08);
}

.form-card-violet:hover .form-card-action {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.08);
}

.form-card-rose:hover .form-card-action {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.08);
}

.form-card-cyan:hover .form-card-action {
    color: #22d3ee;
    background: rgba(6, 182, 212, 0.08);
}

.form-card-action .material-symbols-rounded {
    font-size: 18px;
    transition: transform var(--transition-base);
}

.form-card:hover .form-card-action .material-symbols-rounded {
    transform: translateX(4px);
}

/* Back to forms navigation */
.form-nav-bar {
    margin-bottom: 16px;
}

/* Animation for cards */
.form-card {
    animation: cardFadeIn 0.4s ease backwards;
}

.form-card:nth-child(1) {
    animation-delay: 0.05s;
}

.form-card:nth-child(2) {
    animation-delay: 0.1s;
}

.form-card:nth-child(3) {
    animation-delay: 0.15s;
}

.form-card:nth-child(4) {
    animation-delay: 0.2s;
}

.form-card:nth-child(5) {
    animation-delay: 0.25s;
}

.form-card:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-cards-grid {
        grid-template-columns: 1fr;
    }
}