:root {
    --bg: #f5f7fb;
    --text: #1f2937;
    --muted: #6b7280;
    --card: #ffffff;
    --border: #e5e7eb;
    --primary: #0f172a;
    --primary-hover: #1f2937;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background: var(--bg);
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

p {
    margin: 0;
}

.min-h-screen {
    min-height: 100vh;
}

.container,
.mx-auto {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.card-body {
    padding: 16px;
}

.btn,
button,
input[type="submit"] {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary,
.btn.btn-primary,
button.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary,
.btn.btn-secondary,
button.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: #d1d5db;
}

.btn-danger,
.btn.btn-danger,
button.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.input,
.select,
.textarea,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.label,
label {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #374151;
    font-weight: 600;
}

.table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
}

.table,
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td,
table th,
table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.table th,
table th {
    background: #f8fafc;
    font-weight: 700;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #f3f4f6; color: #374151; }

.invalid-feedback,
.is-invalid + .invalid-feedback {
    display: block;
    color: #b91c1c;
    font-size: 12px;
    margin-top: 4px;
}

.is-invalid {
    border-color: #dc2626;
}

.text-sm { font-size: 13px; color: var(--muted); }
.text-lg { font-size: 18px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 28px; }
.font-bold,
.font-semibold,
.font-black { font-weight: 700; }

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

[class^="col-"],
[class*=" col-"] {
    padding: 0 8px;
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-4 { width: 33.333%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.666%; }
    .offset-md-4 { margin-left: 33.333%; }
    .offset-md-6 { margin-left: 50%; }
}

.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

.justify-content-center { justify-content: center; }
.text-md-end { text-align: right; }
.form-check { display: flex; align-items: center; gap: 8px; }
.btn-link { color: #0f172a; background: transparent; border: 0; padding: 0; }

.pagination {
    display: flex;
    list-style: none;
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
}

.pagination .page-link {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    background: #fff;
    color: #111827;
}

.pagination .active .page-link {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    font-weight: 700;
}

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    margin-bottom: 16px;
}

.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.col-form-label {
    padding-top: 10px;
}

.d-inline {
    display: inline;
}

.align-baseline {
    vertical-align: baseline;
}

.block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.self-end { align-self: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }

.w-full { width: 100%; }
.w-24 { width: 96px; }
.h-40 { height: 160px; }
.h-72 { height: 288px; }
.h-fit { height: fit-content; }
.overflow-hidden { overflow: hidden; }
.sticky { position: sticky; }
.top-8 { top: 32px; }

.max-w-md { max-width: 448px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-7xl { max-width: 1280px; }

.bg-white { background: #ffffff; }
.bg-slate-100 { background: #f1f5f9; }
.bg-slate-200 { background: #e2e8f0; }
.bg-slate-800 { background: #1e293b; }
.bg-slate-900 { background: #0f172a; }
.bg-slate-950 { background: #020617; }
.bg-amber-50 { background: #fffbeb; }
.bg-emerald-50 { background: #ecfdf5; }
.bg-rose-50 { background: #fff1f2; }
.bg-white\/80 { background: rgba(255, 255, 255, 0.8); }
.bg-rose-500\/10 { background: rgba(244, 63, 94, 0.1); }
.bg-\[radial-gradient\(circle_at_top\,_#ffffff\,_#e2e8f0_55\%\,_#cbd5e1\)\] {
    background: radial-gradient(circle at top, #ffffff, #e2e8f0 55%, #cbd5e1);
}

.text-white { color: #ffffff; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-900 { color: #0f172a; }
.text-amber-700 { color: #b45309; }
.text-emerald-700 { color: #047857; }
.text-rose-700 { color: #be123c; }
.text-rose-200 { color: #fecdd3; }
.text-right { text-align: right; }
.text-base { font-size: 16px; }
.text-xs { font-size: 12px; }
.text-xl { font-size: 20px; }
.text-4xl { font-size: 36px; }

.font-medium { font-weight: 500; }
.tracking-tight { letter-spacing: -0.02em; }
.tracking-wide { letter-spacing: 0.03em; }
.tracking-\[0\.3em\] { letter-spacing: 0.3em; }
.uppercase { text-transform: uppercase; }

.border { border: 1px solid #e2e8f0; }
.border-t { border-top: 1px solid #e2e8f0; }
.border-b { border-bottom: 1px solid #e2e8f0; }
.border-r { border-right: 1px solid #e2e8f0; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-rose-200 { border-color: #fecdd3; }
.border-rose-400\/30 { border-color: rgba(251, 113, 133, 0.3); }
.border-amber-200 { border-color: #fde68a; }
.border-white\/60 { border-color: rgba(255, 255, 255, 0.6); }

.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-3xl { border-radius: 24px; }
.rounded-full { border-radius: 9999px; }

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28);
}

.hover\:bg-slate-50:hover { background: #f8fafc; }
.hover\:bg-slate-800:hover { background: #1e293b; }
.hover\:text-slate-900:hover { color: #0f172a; }

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-auto { margin-top: auto; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-8 { margin-top: 32px; }
.p-0 { padding: 0; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-8 { padding: 32px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pb-6 { padding-bottom: 24px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }

@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 768px) {
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:flex-row { flex-direction: row; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:grid-cols-\[1\.2fr_1fr_auto_auto\] { grid-template-columns: 1.2fr 1fr auto auto; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
    .lg\:px-8 { padding-left: 32px; padding-right: 32px; }
    .lg\:grid-cols-\[260px_1fr\] { grid-template-columns: 260px 1fr; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .xl\:grid-cols-\[1\.2fr_420px\] { grid-template-columns: 1.2fr 420px; }
    .xl\:grid-cols-\[1\.3fr_1fr\] { grid-template-columns: 1.3fr 1fr; }
    .xl\:grid-cols-\[1\.4fr_420px\] { grid-template-columns: 1.4fr 420px; }
    .xl\:grid-cols-\[1\.5fr_1fr\] { grid-template-columns: 1.5fr 1fr; }
    .xl\:grid-cols-\[1\.6fr_1fr\] { grid-template-columns: 1.6fr 1fr; }
}

.admin-shell {
    display: flex;
    min-height: 100vh;
    background: #020617;
}

.admin-sidebar {
    --bs-offcanvas-width: 280px;
    background: #0f172a;
    color: #f1f5f9;
}

.admin-sidebar .offcanvas-body {
    padding: 0;
}

.admin-sidebar-panel {
    width: 280px;
    min-height: 100vh;
    padding: 32px 24px;
    border-right: 1px solid #1e293b;
    background: #0f172a;
}

.admin-main {
    flex: 1 1 auto;
    min-width: 0;
    background: #f1f5f9;
    color: #0f172a;
}

.admin-content {
    min-width: 0;
}

.admin-content .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-content .table,
.admin-content table {
    min-width: 720px;
}

.admin-nav {
    display: grid;
    gap: 8px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #cbd5e1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-nav-link i {
    width: 18px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.admin-nav-link:hover,
.admin-nav-link.is-active {
    background: #1e293b;
    color: #ffffff;
}

.admin-nav-link:hover i,
.admin-nav-link.is-active i {
    color: #ffffff;
}

@media (max-width: 991.98px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar-panel {
        width: 100%;
        min-height: auto;
        border-right: 0;
    }

    .admin-main {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .admin-content .table,
    .admin-content table {
        min-width: 640px;
    }

    .table th,
    .table td,
    table th,
    table td {
        padding: 10px;
    }
}

@media (max-width: 575.98px) {
    .admin-sidebar-panel {
        padding: 24px 16px;
    }
}

.min-w-0 { min-width: 0; }

/* Select2 styling to match existing inputs */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 40px;
    padding: 2px 6px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #0f172a;
    border: 0;
    color: #ffffff;
    border-radius: 999px;
    padding: 2px 10px;
    margin-top: 6px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 6px;
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    gap: 6px;
}
