/* Modern Design System - CMS */
:root {
    /* Modern Slate & Indigo Theme */
    --primary-color: #4f46e5;
    /* Indigo 600 - Action Color */
    --primary-dark: #3730a3;
    /* Indigo 800 */
    --secondary-color: #ec4899;
    /* Pink 500 */

    --sidebar-bg: #0f172a;
    /* Slate 900 - Dark Sidebar */
    --sidebar-text: #94a3b8;
    /* Slate 400 */
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #1e293b;
    /* Slate 800 */

    --bg-color: #f1f5f9;
    /* Slate 100 - Main Background */
    --card-bg: #ffffff;

    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --glass-bg: rgba(255, 255, 255, 0.95);
    /* Less transparent for professional look */
    --glass-border: rgba(255, 255, 255, 0.8);

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-md: 0.25rem;
    --radius-lg: 0.5rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

.grid {
    display: grid;
}

.hidden {
    display: none;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Auth Pages (Login) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, #e0e7ff, transparent 40%),
        radial-gradient(circle at bottom right, #fce7f3, transparent 40%),
        var(--bg-color);
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.8);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.role-selector {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.role-option {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.role-option.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    color: white;
    letter-spacing: -0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--sidebar-text);
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link svg {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: var(--transition);
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-link.active svg {
    opacity: 1;
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 1.25rem;
    background-color: var(--bg-color);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-primary-light {
    background: #e0e7ff;
    color: var(--primary-color);
}

.bg-secondary-light {
    background: #fce7f3;
    color: var(--secondary-color);
}

.bg-success-light {
    background: #d1fae5;
    color: var(--success);
}

.bg-warning-light {
    background: #fef3c7;
    color: var(--warning);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    vertical-align: middle;
}

th {
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

html,
body {
    height: 100%;
}

.dashboard-wrapper {
    min-height: 100vh;
}

/* Grid Utilities */
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.col-span-1 {
    grid-column: span 1 / span 1;
}

.col-span-2 {
    grid-column: span 2 / span 2;
}

.col-span-3 {
    grid-column: span 3 / span 3;
}

.col-span-4 {
    grid-column: span 4 / span 4;
}

.col-span-5 {
    grid-column: span 5 / span 5;
}

.col-span-6 {
    grid-column: span 6 / span 6;
}

.col-span-8 {
    grid-column: span 8 / span 8;
}

.col-span-12 {
    grid-column: span 12 / span 12;
}

/* Spacing Utilities */
.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-8 {
    margin-top: 2rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.w-full {
    width: 100%;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xl {
    font-size: 1.25rem;
}

.font-bold {
    font-weight: 700;
}

.text-red-600 {
    color: #dc2626;
}

.text-green-700 {
    color: #15803d;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-green-50 {
    background-color: #f0fdf4;
}

.rounded {
    border-radius: var(--radius-md);
}

.border {
    border: 1px solid var(--border-color);
}

/* Custom Form Elements */
.hidden-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Border Colors */
.border-green-200 {
    border-color: #bbf7d0 !important;
}

.border-green-600 {
    border-color: #16a34a !important;
}

/* Flex Utilities */
.flex-1 {
    flex: 1 1 0%;
}

.flex-2 {
    flex: 2 1 0%;
}

/* Replaces invalid flex-[2] */

/* Gap Utilities (Extended) */
.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

/* Text Colors (Extended) */
.text-primary {
    color: var(--primary-color);
}

/* Alignment */
.items-start {
    align-items: flex-start;
}

/* Gradient Card Styles */
.card-gradient-1 {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    color: white;
    border: none;
}

.card-gradient-2 {
    background: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%) !important;
    color: white;
    border: none;
}

.card-gradient-3 {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
    color: white;
    border: none;
}

.card-gradient-4 {
    background: linear-gradient(135deg, #ef4444 0%, #be123c 100%) !important;
    color: white;
    border: none;
}

.card-gradient-1 .stat-icon,
.card-gradient-2 .stat-icon,
.card-gradient-3 .stat-icon,
.card-gradient-4 .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.card-gradient-1 p,
.card-gradient-2 p,
.card-gradient-3 p,
.card-gradient-4 p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Print Styles */
@media print {

    .sidebar,
    .btn,
    .card-header a {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: none;
    }
}

/* Alert Styles */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Search Bar Styles */
.search-bar-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 2rem;
}

.search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    background: var(--bg-color);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 280px;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }

    .mobile-only {
        display: block !important;
    }

    .hidden-mobile {
        display: none !important;
    }

    .search-bar-wrapper {
        margin: 0 1rem;
        max-width: 200px;
    }

    .top-bar {
        gap: 0.5rem;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .sidebar.show+.sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Global Loader Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loader-overlay.show {
    display: flex;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-color);
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}