/* Shadcn-inspired CSS Variables */
:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;

    --radius: 0.5rem;
}

body {
    background-color: hsl(228deg 41.67% 95.29%);
    color: hsl(var(--foreground));
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    line-height: 1.5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-top: 0;
}

/* Layout */
.layout-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Modern Glassmorphic Sidebar */
.sidebar {
    width: 260px;
    background: hsl(var(--card) / 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid hsl(var(--border));
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    transition: transform 0.3s ease;
    z-index: 50;
    height: 100%;
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 80%;
        max-width: 300px;
        box-shadow: 10px 0 20px rgba(0, 0, 0, 0.1);
    }

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

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    width: 100%;
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        padding-top: 4rem;
    }
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 30;
    padding: 0.5rem;
    background: white;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Components */
.card {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    height: 2.5rem;
    padding: 0 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid transparent;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

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

.btn-outline:hover {
    background-color: hsl(var(--accent));
}

/* Inputs */
input:not([type="checkbox"]),
select,
textarea {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--input));
    background-color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.1);
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    display: block;
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    min-height: 1rem;
    border: 1px solid hsl(var(--input));
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

input[type="checkbox"]:checked::after {
    content: "";
    width: 0.625rem;
    height: 0.625rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    display: block;
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.1);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th {
    height: 3rem;
    padding: 0 1rem;
    text-align: left;
    background-color: hsl(var(--muted) / 0.5);
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    border-bottom: 1px solid hsl(var(--border));
}

td {
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--border));
}

tr:hover {
    background-color: hsl(var(--muted) / 0.3);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.badge-default,
.badge-primary {
    background-color: hsl(var(--primary)) !important;
    color: hsl(var(--primary-foreground)) !important;
}

.badge-secondary {
    background-color: hsl(var(--secondary)) !important;
    color: hsl(var(--secondary-foreground)) !important;
}

.badge-outline {
    color: hsl(var(--muted-foreground)) !important;
    border: 1px solid hsl(var(--border)) !important;
    background-color: transparent !important;
}

.badge-success {
    background-color: #f0fdf4 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
}

.badge-destructive {
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

/* Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.nav-link.active {
    background-color: hsl(var(--secondary));
    color: hsl(var(--foreground));
    font-weight: 600;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: hsl(var(--foreground));
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

/* Pagination */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    gap: 0.25rem;
    justify-content: center;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    min-width: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid hsl(var(--border));
    background-color: white;
    text-decoration: none;
}

.pagination li.active span {
    background-color: hsl(var(--secondary));
}

/* Utilities */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-destructive {
    color: hsl(var(--destructive));
}

.font-monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cursor-pointer {
    cursor: pointer;
}

.transition-all {
    transition: all 0.2s;
}

.hover-bg-light:hover {
    background-color: hsl(var(--muted)) !important;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.opacity-70 {
    opacity: 0.7;
}

.text-uppercase {
    text-transform: uppercase;
}

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