@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --background: #ffffff;
    --foreground: #020817;
    --card: #ffffff;
    --card-foreground: #020817;
    --popover: #ffffff;
    --popover-foreground: #020817;
    --primary: #0f172a;
    --primary-foreground: #f8fafc;
    --secondary: #f1f5f9;
    --secondary-foreground: #0f172a;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;
    --destructive: #ef4444;
    --destructive-foreground: #f8fafc;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --ring: #94a3b8;
    --radius: 0.5rem;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: var(--foreground);
    overflow-x: hidden;
    font-size: 0.875rem;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

/* Sidebar Styling */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar-wrapper {
    min-width: 250px;
    max-width: 250px;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: margin 0.25s ease-out;
    background-color: var(--background);
    border-right: 1px solid var(--border);
    z-index: 1000;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground) !important;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

#sidebar-wrapper .list-group {
    width: 245px;
    padding: 1rem 0.75rem;
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--muted-foreground) !important;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}

#sidebar-wrapper .list-group-item i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

#sidebar-wrapper .list-group-item:hover {
    color: var(--foreground) !important;
    background-color: var(--accent) !important;
}

#sidebar-wrapper .list-group-item.active {
    color: var(--foreground) !important;
    background-color: var(--muted) !important;
    font-weight: 600;
}

/* Sidebar Submenu */
.sidebar-submenu .list-group-item {
    padding-left: 2.75rem !important;
    font-size: 0.8125rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}
.sidebar-submenu .list-group-item.active {
    background-color: transparent !important;
    color: var(--foreground) !important;
    font-weight: 600;
}
.sidebar-submenu-toggle::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}
.sidebar-submenu-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

#page-content-wrapper {
    min-width: 0;
    width: 100%;
    background-color: #f8fafc;
}

/* Toggled State */
#wrapper.toggled #sidebar-wrapper {
    margin-left: -250px;
}

/* Navbar Styling */
.navbar {
    background-color: var(--background) !important;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--foreground);
}

.cursor-pointer {
    cursor: pointer;
}

/* Cards (Shadcn style) */
.card {
    background-color: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: none; /* remove hover transform */
}

.card:hover {
    transform: none;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
}

.card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Buttons */
.btn {
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    transition: colors 0.15s ease-in-out;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: rgba(15, 23, 42, 0.9);
    border-color: rgba(15, 23, 42, 0.9);
    color: var(--primary-foreground);
}

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

.btn-outline-primary:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--border);
}

/* Tables */
.table {
    font-size: 0.875rem;
}

.table th {
    font-weight: 500;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

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

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.bg-primary-subtle { background-color: #e0e7ff !important; color: #3730a3 !important; }
.bg-success-subtle { background-color: #dcfce7 !important; color: #166534 !important; }
.bg-warning-subtle { background-color: #fef9c3 !important; color: #854d0e !important; }
.bg-danger-subtle { background-color: #fee2e2 !important; color: #991b1b !important; }
.bg-info-subtle { background-color: #e0f2fe !important; color: #075985 !important; }

/* Stat Cards (Shadcn style) */
.stat-card {
    padding: 1.5rem;
}
.stat-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
}
.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-top: 0.25rem;
}

/* Loader */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

/* Forms */
.form-control, .form-select {
    font-size: 0.875rem;
    border-radius: var(--radius);
    border-color: var(--input);
    padding: 0.5rem 0.75rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 1px var(--ring);
}
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

/* Split Login Screen */
.login-split {
    height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background-color: var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--primary-foreground);
    padding: 3rem;
}

.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--background);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: -250px;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        height: 100vh;
        box-shadow: 0 0 15px rgba(0,0,0,0.1);
    }
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
    .login-left {
        display: none;
    }
}
