/* ===================== Admindek theme ===================== */
:root {
    --adk-navy: #263544;
    --adk-navy-dark: #1d2531;
    --adk-nav-text: #b7c0cd;
    --adk-accent: #42a5f5;
    --adk-bg: #f2f7fb;
    --adk-blue: #4099ff;
    --adk-green: #2ed8b6;
    --adk-yellow: #ffb64d;
    --adk-red: #ff5370;
    --adk-cyan: #00bcd4;
    --adk-sidebar-w: 250px;
    --adk-header-h: 70px;
}

.bg-c-blue { background: var(--adk-blue); }
.bg-c-green { background: var(--adk-green); }
.bg-c-yellow { background: var(--adk-yellow); }
.bg-c-red { background: var(--adk-red); }
.bg-c-cyan { background: var(--adk-cyan); }
.bg-c-navy { background: var(--adk-navy); }
.text-c-blue { color: var(--adk-blue); }
.text-c-green { color: var(--adk-green); }
.text-c-yellow { color: var(--adk-yellow); }
.text-c-red { color: var(--adk-red); }

.adk-body {
    background-color: var(--adk-bg);
    background-image: linear-gradient(rgba(255, 255, 255, 0.7) 240px, var(--adk-bg) 0%);
    color: #333;
    font-size: 0.9375rem;
    min-height: 100vh;
}
.dark .adk-body { background: #111827; color: #e5e7eb; }

/* Header */
.adk-header {
    position: fixed; top: 0; right: 0; left: 0;
    height: var(--adk-header-h);
    display: flex; z-index: 1030;
}
.adk-logo {
    width: var(--adk-sidebar-w); flex-shrink: 0;
    display: flex; align-items: center; gap: .5rem;
    padding: 0 1rem 0 .75rem;
    background: var(--adk-navy);
    box-shadow: 0 4px 4px -4px rgba(0, 0, 0, .1);
    transition: width .3s ease;
}
.adk-logo-toggle {
    width: 36px; height: 36px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px; border-radius: 4px;
}
.adk-logo-toggle:hover { background: rgba(255, 255, 255, .08); }
.adk-navbar {
    flex: 1; min-width: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem;
    background: #fff;
    box-shadow: 0 1px 20px 0 rgba(69, 90, 100, .08);
}
.dark .adk-navbar { background: #1f2937; box-shadow: 0 1px 0 0 #374151; }
.adk-header-btn {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 20px; color: #37474f;
    transition: background-color .2s ease, color .2s ease;
}
.adk-header-btn:hover { background: var(--adk-bg); color: var(--adk-accent); }
.dark .adk-header-btn { color: #d1d5db; }
.dark .adk-header-btn:hover { background: #374151; }
.adk-header-badge {
    position: absolute; top: 6px; left: 6px;
    min-width: 18px; height: 18px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px; color: #fff; font-size: 10px; font-weight: 700;
}
.adk-header-badge.hidden, .adk-badge.hidden { display: none; }
.adk-search {
    width: 16rem; height: 40px;
    padding: 0 2.5rem 0 1rem;
    background: var(--adk-bg); border: 1px solid transparent; border-radius: 20px;
    font-size: 14px; color: #333; text-align: right;
    transition: border-color .2s ease, background-color .2s ease;
}
.adk-search:focus { outline: none; background: #fff; border-color: var(--adk-accent); }
.dark .adk-search { background: #374151; color: #f3f4f6; }

.adk-dropdown {
    position: absolute; top: calc(100% - 6px); left: 0;
    background: #fff; border-radius: 5px; overflow: hidden;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, .15);
    z-index: 1040;
    animation: adkFadeIn .2s ease;
}
.dark .adk-dropdown { background: #1f2937; box-shadow: 0 0 20px 0 rgba(0, 0, 0, .5); }
.adk-dropdown-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .65rem 1.25rem; font-size: 14px; color: #333;
    transition: background-color .2s ease;
}
.adk-dropdown-item:hover { background: #f1f1f1; }
.adk-dropdown-item i { font-size: 16px; color: #919aa3; }
.dark .adk-dropdown-item { color: #e5e7eb; }
.dark .adk-dropdown-item:hover { background: #374151; }
@keyframes adkFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Sidebar */
.adk-sidebar {
    position: fixed; top: var(--adk-header-h); right: 0; bottom: 0;
    width: var(--adk-sidebar-w);
    display: flex; flex-direction: column; justify-content: space-between;
    background: var(--adk-navy);
    overflow-y: auto; z-index: 1027;
    transition: transform .3s ease;
}
.adk-nav-label {
    color: #f1f7ff; font-size: 12px; font-weight: 600;
    padding: 22px 18px 6px; letter-spacing: .02em;
}
.adk-nav { list-style: none; margin: 0; padding: 0; }
.adk-nav-link {
    width: 100%;
    display: flex; align-items: center; gap: 8px;
    margin-top: 5px; padding: 7px 18px 7px 12px;
    border-right: 3px solid transparent;
    color: var(--adk-nav-text); font-size: 14px; text-align: right;
    transition: color .2s ease, background-color .2s ease;
}
.adk-nav-icon {
    width: 30px; height: 30px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px; font-size: 17px;
}
.adk-nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adk-nav-arrow { font-size: 16px; transition: transform .25s ease; }
.adk-nav-item > .adk-nav-link:hover { color: #fff; }
.adk-nav-item.active > .adk-nav-link,
.adk-nav-item.open > .adk-nav-link {
    background: var(--adk-navy-dark);
    border-right-color: var(--adk-accent);
    color: #fff;
}
.adk-nav-item.open > .adk-nav-link .adk-nav-arrow { transform: rotate(-90deg); }
.adk-submenu {
    list-style: none; margin: 0; padding: 0;
    display: none;
    background: rgba(29, 37, 49, .5);
}
.adk-nav-item.open > .adk-submenu { display: block; }
.adk-submenu a {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 46px 10px 12px;
    color: var(--adk-nav-text); font-size: 14px;
    transition: color .2s ease;
}
.adk-submenu a i { font-size: 13px; }
.adk-submenu a:hover,
.adk-submenu li.active > a { color: var(--adk-accent); }
.adk-submenu li.active > a { font-weight: 600; }
.adk-badge {
    min-width: 20px; padding: 2px 7px; border-radius: 10px;
    color: #fff; font-size: 10px; font-weight: 700; line-height: 1.4; text-align: center;
}
.adk-sidebar-footer { padding: 8px 0 14px; border-top: 1px solid #384f65; }
.adk-sidebar-footer .adk-nav-link:hover { color: var(--adk-red); }
.scrollbar-dark::-webkit-scrollbar { width: 5px; }
.scrollbar-dark::-webkit-scrollbar-thumb { background: #384f65; border-radius: 3px; }

/* Main */
.adk-main {
    padding-top: var(--adk-header-h);
    margin-right: var(--adk-sidebar-w);
    min-height: 100vh;
    transition: margin .3s ease;
}
body.sidebar-collapsed .adk-sidebar { transform: translateX(100%); }
body.sidebar-collapsed .adk-main { margin-right: 0; }
@media (max-width: 1023px) {
    .adk-logo { width: auto; padding: 0 .75rem; }
    .adk-sidebar { transform: translateX(100%); z-index: 1035; }
    .adk-main { margin-right: 0; }
    body.sidebar-open .adk-sidebar { transform: none; }
}

/* Page header */
.adk-page-header {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem;
    padding: 1.75rem 1.5rem .8rem;
}
.adk-page-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px; color: #fff; font-size: 22px;
    box-shadow: 0 2px 12px -3px rgba(0, 0, 0, .5);
}
.adk-page-title { font-size: 1.15rem; font-weight: 700; color: #333; margin: 0; }
.adk-page-subtitle { font-size: 13px; color: #919aa3; }
.dark .adk-page-title { color: #f3f4f6; }
.adk-breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: 14px; color: #919aa3; }
.adk-breadcrumb a:hover { color: var(--adk-accent); }
.adk-breadcrumb .current { color: #333; font-weight: 600; }
.dark .adk-breadcrumb .current { color: #e5e7eb; }

/* Cards */
.adk-card {
    background: #fff; border-radius: 5px;
    box-shadow: 0 0 5px 0 rgba(43, 43, 43, .1), 0 11px 6px -7px rgba(43, 43, 43, .1);
    transition: box-shadow .3s ease-in-out;
}
.adk-card:hover { box-shadow: 0 0 25px -5px #9e9c9e; }
.dark .adk-card { background: #1f2937; box-shadow: 0 0 0 1px #374151; }
.adk-card-header {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: 20px;
}
.adk-card-header h5 { margin: 0; font-size: 15px; font-weight: 700; color: #333; }
.dark .adk-card-header h5 { color: #f3f4f6; }
.adk-card-block { padding: 1.25rem; }
.adk-comp-icon {
    width: 50px; height: 50px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px; color: #fff; font-size: 20px;
    text-shadow: 0 6px 8px rgba(62, 57, 107, .18);
    transition: border-radius .3s ease-in-out;
}
.adk-card:hover .adk-comp-icon { border-radius: 50%; }
.adk-progress { height: 7px; background: #eef1f5; border-radius: 4px; position: relative; }
.dark .adk-progress { background: #374151; }
.adk-progress > span { position: absolute; top: 0; right: 0; height: 100%; border-radius: 4px; }
.adk-progress > span::after {
    content: ""; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
    width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid currentColor;
}
.adk-label {
    display: inline-block; padding: 3px 8px; border-radius: 3px;
    color: #fff; font-size: 11px; font-weight: 600; line-height: 1.2;
}

/* Tables */
.adk-table { width: 100%; text-align: right; }
.adk-table thead th {
    padding: .85rem 1.25rem; font-size: 13px; font-weight: 700; color: #333;
    border-bottom: 1px solid #e9ecef; white-space: nowrap;
}
.adk-table tbody td { padding: .85rem 1.25rem; font-size: 14px; color: #555; border-top: 1px solid #f1f1f1; }
.adk-table tbody tr:hover { background: #f8fafc; }
.dark .adk-table thead th { color: #e5e7eb; border-color: #374151; }
.dark .adk-table tbody td { color: #d1d5db; border-color: #374151; }
.dark .adk-table tbody tr:hover { background: #111827; }

/* Auth pages */
.adk-auth {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
    background: var(--adk-accent);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .14) 0, transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(38, 53, 68, .25) 0, transparent 40%);
}
.adk-auth-box {
    width: 100%; max-width: 450px;
    background: #fff; border-radius: 5px;
    box-shadow: 0 0 5px 0 rgba(43, 43, 43, .1), 0 11px 6px -7px rgba(43, 43, 43, .1);
    padding: 2.25rem 2rem;
}
.adk-auth-title { color: var(--adk-blue); font-size: 1.6rem; font-weight: 700; text-align: center; }
.adk-input {
    width: 100%; height: 44px;
    padding: 0 2.5rem 0 1rem;
    border: 1px solid #ccc; border-radius: 2px;
    font-size: 14px; color: #333; background: #fff;
    transition: border-color .2s ease;
}
.adk-input:focus { outline: none; border-color: var(--adk-blue); }
.adk-input.is-invalid { border-color: var(--adk-red); }
.adk-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: 10px 19px; border-radius: 2px;
    font-size: 15px; font-weight: 600; color: #fff;
    transition: background-color .3s ease-in;
}
.adk-btn-primary { background: var(--adk-blue); }
.adk-btn-primary:hover { background: #0d7eff; }

/* =========================================================================
   Legacy bridge: restyles the existing Tailwind screens with Admindek look.
   Scoped to the content area (.adk-main) and central admin pages (.adk-scope).
   ========================================================================= */

:is(.adk-main, .adk-scope) h1:is(.text-xl, .text-2xl, .text-3xl) { font-size: 1.2rem; font-weight: 700; }
html:not(.dark) :is(.adk-main, .adk-scope) h1:is(.text-xl, .text-2xl, .text-3xl) { color: #333; }

/* Cards */
:is(.adk-main, .adk-scope) :is(div, section, form, article).bg-white:is(.rounded, .rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl):is(.shadow, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl) {
    border-radius: 5px;
    border-color: transparent;
    box-shadow: 0 0 5px 0 rgba(43, 43, 43, .1), 0 11px 6px -7px rgba(43, 43, 43, .1);
    transition: box-shadow .3s ease-in-out;
}
:is(.adk-main, .adk-scope) :is(div, section, form, article).bg-white:is(.rounded, .rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl):is(.hover\:shadow-md, .hover\:shadow-lg, .hover\:shadow-xl):hover {
    box-shadow: 0 0 25px -5px #9e9c9e;
}
.dark :is(.adk-main, .adk-scope) :is(div, section, form, article).bg-white:is(.shadow, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl) {
    box-shadow: 0 0 0 1px #374151;
}
:is(.adk-main, .adk-scope) .hover\:scale-105:hover,
:is(.adk-main, .adk-scope) .hover\:scale-\[1\.02\]:hover { transform: none; }

/* Card header strip */
:is(.adk-main, .adk-scope) .bg-white > .border-b:first-child :is(h2, h3) { font-size: 15px; font-weight: 700; }
html:not(.dark) :is(.adk-main, .adk-scope) .bg-white > .border-b:first-child { border-bottom-color: #f1f1f1; }
html:not(.dark) :is(.adk-main, .adk-scope) .bg-white > .border-b:first-child :is(h2, h3) { color: #333; }

/* Statistic cards (comp-card) */
html:not(.dark) .adk-main .min-h-\[100px\]:hover { background-color: #fff; border-color: transparent; box-shadow: 0 0 25px -5px #9e9c9e; }
.adk-main .min-h-\[100px\] .p-2.rounded-lg {
    width: 50px; height: 50px; padding: 0; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 5px; background: var(--adk-blue);
    transition: border-radius .3s ease-in-out;
}
.adk-main .min-h-\[100px\]:hover .p-2.rounded-lg { border-radius: 50%; }
.adk-main .min-h-\[100px\] .p-2.rounded-lg i { color: #fff; font-size: 20px; transform: none; text-shadow: 0 6px 8px rgba(62, 57, 107, .18); }
.adk-main .min-h-\[100px\] .p-2.rounded-lg:is([class*="bg-green"], [class*="bg-emerald"], [class*="bg-teal"]) { background: var(--adk-green); }
.adk-main .min-h-\[100px\] .p-2.rounded-lg:is([class*="bg-yellow"], [class*="bg-amber"], [class*="bg-orange"]) { background: var(--adk-yellow); }
.adk-main .min-h-\[100px\] .p-2.rounded-lg:is([class*="bg-red"], [class*="bg-rose"], [class*="bg-pink"]) { background: var(--adk-red); }
.adk-main .min-h-\[100px\] .p-2.rounded-lg:is([class*="bg-purple"], [class*="bg-violet"], [class*="bg-indigo"]) { background: #a389d4; }
.adk-main .min-h-\[100px\] .p-2.rounded-lg:is([class*="bg-cyan"], [class*="bg-sky"]) { background: var(--adk-cyan); }
.adk-main .min-h-\[100px\] .p-2.rounded-lg[class*="bg-gray"] { background: #37474f; }

/* Tables */
:is(.adk-main, .adk-scope) table thead,
:is(.adk-main, .adk-scope) table thead tr { background: transparent !important; }
:is(.adk-main, .adk-scope) table thead th {
    font-size: 13px; font-weight: 700;
    text-transform: none; letter-spacing: 0; white-space: nowrap;
    border-bottom: 1px solid #e9ecef;
}
html:not(.dark) :is(.adk-main, .adk-scope) table thead th { color: #333; }
.dark :is(.adk-main, .adk-scope) table thead th { color: #e5e7eb; border-color: #374151; }
html:not(.dark) :is(.adk-main, .adk-scope) table tbody.divide-y > tr { border-color: #f1f1f1; }
html:not(.dark) :is(.adk-main, .adk-scope) table tbody tr:hover { background-color: #f8fafc; }

/* Form controls */
:is(.adk-main, .adk-scope) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), select, textarea).border {
    border-radius: 2px;
}
html:not(.dark) :is(.adk-main, .adk-scope) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), select, textarea).border:not(.border-red-500) {
    border-color: #ccc;
}
:is(.adk-main, .adk-scope) :is(input, select, textarea):focus {
    border-color: var(--adk-blue) !important;
    box-shadow: none !important;
    outline: none;
}
:is(.adk-main, .adk-scope) .choices__inner { border-radius: 2px; }
html:not(.dark) :is(.adk-main, .adk-scope) .choices__inner { border-color: #ccc; }

/* Buttons */
:is(.adk-main, .adk-scope) :is(a, button)[class*="bg-"]:is(.rounded, .rounded-md, .rounded-lg, .rounded-xl):not(.p-1):not(.p-2):not(.p-3) {
    border-radius: 2px;
}

/* Status badges (label) */
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"]:is([class*="bg-blue-1"], [class*="bg-primary-1"], [class*="bg-indigo-1"], [class*="bg-sky-1"], [class*="bg-cyan-1"], [class*="bg-green-1"], [class*="bg-emerald-1"], [class*="bg-teal-1"], [class*="bg-yellow-1"], [class*="bg-amber-1"], [class*="bg-orange-1"], [class*="bg-red-1"], [class*="bg-rose-1"], [class*="bg-pink-1"], [class*="bg-purple-1"], [class*="bg-violet-1"], [class*="bg-gray-1"]) {
    border-radius: 3px; font-weight: 600; color: #fff;
}
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"]:is([class*="bg-blue-1"], [class*="bg-primary-1"], [class*="bg-indigo-1"]) { background: var(--adk-blue); }
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"]:is([class*="bg-sky-1"], [class*="bg-cyan-1"]) { background: var(--adk-cyan); }
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"]:is([class*="bg-green-1"], [class*="bg-emerald-1"], [class*="bg-teal-1"]) { background: var(--adk-green); }
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"]:is([class*="bg-yellow-1"], [class*="bg-amber-1"], [class*="bg-orange-1"]) { background: var(--adk-yellow); }
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"]:is([class*="bg-red-1"], [class*="bg-rose-1"], [class*="bg-pink-1"]) { background: var(--adk-red); }
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"]:is([class*="bg-purple-1"], [class*="bg-violet-1"]) { background: #a389d4; }
:is(.adk-main, .adk-scope) span.rounded-full.text-xs[class*="px-"][class*="bg-gray-1"] { background: #919aa3; }

/* Pagination */
:is(.adk-main, .adk-scope) nav[role="navigation"] :is(a, span[aria-disabled]) > span,
:is(.adk-main, .adk-scope) nav[role="navigation"] a { border-radius: 2px; }
:is(.adk-main, .adk-scope) nav[role="navigation"] [aria-current="page"] > span {
    background: var(--adk-blue); border-color: var(--adk-blue); color: #fff;
}
