:root {
    --app-bg: #f4f7fb;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --line: #d8dee8;
    --line-strong: #b8c2d2;
    --ink: #182230;
    --muted: #637083;
    --muted-strong: #475467;
    --brand: #00bbd6;
    --brand-strong: #1e2a78;
    --brand-deep: #0d1333;
    --brand-accent: #22d3b5;
    --brand-soft: #e6ebf2;
    --amber: #b7791f;
    --amber-soft: #fff4d6;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --success: #067647;
    --success-soft: #dcfae6;
    --sidebar-bg: #0d1333;
    --sidebar-panel: #111a4a;
    --sidebar-line: rgba(255, 255, 255, .08);
    --sidebar-muted: #96a1b3;
    --radius-sm: 6px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-md: 0 10px 28px rgba(16, 24, 40, .10);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--app-bg);
}

body {
    min-width: 320px;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(0, 187, 214, .08), rgba(0, 187, 214, 0) 260px),
        var(--app-bg);
    font-family: Sora, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border-radius: var(--radius-sm) !important;
}

input,
select,
textarea {
    border-color: var(--line) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--ink);
    background-color: #fff;
    box-shadow: none !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(0, 187, 214, .18) !important;
    outline: none !important;
}

label {
    color: var(--muted-strong) !important;
    font-weight: 600 !important;
}

.app-shell {
    background: transparent;
}

.app-sidebar {
    width: 280px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 220px),
        var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-line);
}

.app-brand {
    min-height: 76px;
    justify-content: flex-start !important;
    gap: 12px;
    padding: 0 22px !important;
    background: var(--sidebar-panel) !important;
    border-bottom: 1px solid var(--sidebar-line);
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    color: #ecfeff;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand-strong));
    font-weight: 800;
    overflow: hidden;
}

.brand-mark-image {
    border: 0;
    background: transparent;
    box-shadow: 0 8px 18px rgba(13, 19, 51, .18);
}

.brand-mark-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text {
    line-height: 1.15;
}

.brand-title {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.brand-subtitle {
    display: block;
    color: var(--sidebar-muted);
    font-size: 12px;
    font-weight: 500;
}

#main-tabs {
    padding: 18px 14px 22px !important;
}

#main-tabs h3 {
    margin: 18px 10px 8px;
    color: #7f8ca1 !important;
    font-size: 11px;
    letter-spacing: .08em;
}

.nav-button {
    min-height: 42px;
    color: #c7d0de !important;
    border: 1px solid transparent;
    border-radius: 7px !important;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.nav-button svg {
    width: 19px !important;
    height: 19px !important;
    color: #94a3b8;
}

.nav-button:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .07) !important;
    border-color: rgba(255, 255, 255, .08);
}

.nav-button.active {
    color: #ecfeff !important;
    background: rgba(0, 187, 214, .20) !important;
    border-color: rgba(34, 211, 181, .30);
}

.nav-button.active svg {
    color: var(--brand-accent) !important;
}

.app-header {
    min-height: 68px;
    background: rgba(255, 255, 255, .92) !important;
    border-bottom: 1px solid var(--line);
    box-shadow: none !important;
    backdrop-filter: blur(14px);
}

.app-header-inner {
    min-height: 68px;
    padding: 0 28px !important;
}

.app-page-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 700;
}

.app-page-label::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

#main-content-wrapper {
    background: transparent;
}

#main-content {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 28px 28px 40px !important;
}

#main-content h1 {
    margin: 0 0 18px;
    color: var(--ink) !important;
    font-size: 24px !important;
    font-weight: 800 !important;
}

#main-content h2 {
    color: var(--ink) !important;
    font-size: 20px !important;
    font-weight: 800 !important;
}

#main-content h3 {
    color: var(--ink) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
}

#main-content .bg-white,
#main-content .shadow-lg {
    border: 1px solid var(--line);
    border-radius: var(--radius) !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-sm) !important;
}

#main-content .rounded-xl {
    border-radius: var(--radius) !important;
}

#main-content .rounded-lg {
    border-radius: var(--radius-sm) !important;
}

#main-content .border-b,
#main-content .border-t {
    border-color: var(--line) !important;
}

#main-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

#main-content thead {
    background: #eef3f7 !important;
}

#main-content th {
    color: var(--muted-strong) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
}

#main-content td,
#main-content th {
    border-bottom: 1px solid var(--line);
}

#main-content tbody tr:last-child td {
    border-bottom: 0;
}

#main-content tbody tr:hover {
    background: #f8fbfc;
}

#main-content .bg-gray-50,
#main-content .bg-gray-100 {
    background-color: var(--surface-subtle) !important;
}

#main-content .text-indigo-600,
#main-content .text-indigo-700,
a.text-indigo-600 {
    color: var(--brand) !important;
}

.text-teal-700,
a.text-teal-700 {
    color: var(--brand-strong) !important;
}

.bg-teal-700,
button.bg-teal-700,
a.bg-teal-700 {
    background-color: var(--brand-strong) !important;
}

.hover\:bg-teal-800:hover {
    background-color: var(--brand-deep) !important;
}

.focus\:ring-teal-600:focus {
    --tw-ring-color: rgba(0, 187, 214, .35) !important;
}

#main-content .bg-indigo-600,
#main-content button.bg-indigo-600,
#modal-container .bg-indigo-600 {
    background-color: var(--brand-strong) !important;
}

#main-content .hover\:bg-indigo-700:hover,
#modal-container .hover\:bg-indigo-700:hover {
    background-color: var(--brand-deep) !important;
}

#main-content .focus\:ring-indigo-500:focus,
#modal-container .focus\:ring-indigo-500:focus {
    --tw-ring-color: rgba(0, 187, 214, .35) !important;
}

#main-content button {
    min-height: 38px;
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

#main-content button:not(.nav-button):hover {
    transform: translateY(-1px);
}

#main-content form {
    color: var(--ink);
}

#main-content form .grid {
    align-items: start;
}

#main-content input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px !important;
    accent-color: var(--brand);
}

#main-content input[type="number"] {
    font-variant-numeric: tabular-nums;
}

#main-content .divide-y > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--line) !important;
}

#main-content .text-gray-500,
#main-content .text-gray-600 {
    color: var(--muted) !important;
}

#main-content .text-gray-700,
#main-content .text-gray-800,
#main-content .text-gray-900 {
    color: var(--ink) !important;
}

#main-content .bg-yellow-100,
#main-content .bg-amber-50 {
    background-color: var(--amber-soft) !important;
}

#main-content .text-yellow-600,
#main-content .text-amber-700 {
    color: var(--amber) !important;
}

#main-content .bg-green-100,
#main-content .bg-emerald-50 {
    background-color: var(--success-soft) !important;
}

#main-content .text-green-600,
#main-content .text-emerald-700 {
    color: var(--success) !important;
}

#main-content .bg-red-100,
#main-content .bg-red-50 {
    background-color: var(--danger-soft) !important;
}

#main-content .text-red-600,
#main-content .text-red-700 {
    color: var(--danger) !important;
}

#main-content .max-w-4xl {
    max-width: 1120px !important;
}

#main-content .space-y-8 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 26px !important;
}

#main-content [id$="-message"] {
    min-height: 20px;
}

#main-content a[href*="/print"],
#main-content button[data-action],
#main-content .print-btn {
    white-space: nowrap;
}

.loader {
    width: 34px;
    height: 34px;
    border: 3px solid #d9e1ea;
    border-top-color: var(--brand);
    border-radius: 999px;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.search-results {
    max-height: 210px;
    overflow-y: auto;
    z-index: 30;
    position: absolute;
    width: 100%;
    margin-top: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background-color: white;
    box-shadow: var(--shadow-md);
}

.search-results div {
    padding: 10px 12px;
}

.search-results div:hover {
    background: #eef9fc;
}

#status-indicator {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

#modal-container {
    background: rgba(15, 23, 42, .58) !important;
    backdrop-filter: blur(5px);
}

#modal-panel {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-md) !important;
}

#modal-title {
    color: var(--ink) !important;
    font-size: 18px !important;
    font-weight: 800 !important;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid rgba(13, 19, 51, .12);
    border-radius: 8px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 0%, rgba(0, 187, 214, .35), transparent 34%),
        linear-gradient(135deg, #0d1333 0%, #142060 55%, #1e2a78 100%);
    box-shadow: 0 18px 42px rgba(13, 19, 51, .18);
}

#main-content .dashboard-hero h1 {
    margin: 6px 0 8px !important;
    color: #fff !important;
    font-size: 28px !important;
}

#main-content .dashboard-hero p {
    max-width: 720px;
    color: rgba(255, 255, 255, .76);
    font-size: 14px;
}

.dashboard-eyebrow,
.dashboard-card-kicker {
    margin: 0;
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dashboard-hero .dashboard-eyebrow {
    color: #22d3b5;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-quick-btn,
.dashboard-ghost-btn,
.dashboard-link-btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
    font-size: 13px;
    font-weight: 800;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.dashboard-quick-btn {
    border: 1px solid transparent;
    padding: 0 16px;
    color: #0d1333;
    background: #fff;
}

.dashboard-ghost-btn {
    border: 1px solid rgba(255, 255, 255, .22);
    padding: 0 14px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.dashboard-link-btn {
    border: 1px solid var(--line);
    padding: 0 10px;
    color: var(--brand-strong);
    background: #fff;
}

.dashboard-quick-btn:hover,
.dashboard-ghost-btn:hover,
.dashboard-link-btn:hover {
    transform: translateY(-1px);
}

.dashboard-grid {
    display: grid;
    gap: 16px;
}

.dashboard-grid-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-span-2 {
    grid-column: span 2;
}

.dashboard-metric,
.dashboard-card {
    border: 1px solid rgba(216, 222, 232, .92);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .07);
}

.dashboard-metric {
    display: flex;
    min-height: 128px;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    overflow: hidden;
    position: relative;
}

.dashboard-metric::after {
    content: "";
    position: absolute;
    right: -26px;
    top: -34px;
    width: 112px;
    height: 112px;
    border-radius: 999px;
    opacity: .13;
}

.dashboard-metric-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-size: 19px;
    font-weight: 900;
}

.dashboard-tone-cyan .dashboard-metric-icon,
.dashboard-tone-cyan::after {
    background: #00bbd6;
}

.dashboard-tone-amber .dashboard-metric-icon,
.dashboard-tone-amber::after {
    background: #f59e0b;
}

.dashboard-tone-emerald .dashboard-metric-icon,
.dashboard-tone-emerald::after {
    background: #22d3b5;
}

.dashboard-tone-blue .dashboard-metric-icon,
.dashboard-tone-blue::after {
    background: #1e2a78;
}

.dashboard-metric-label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-metric-value {
    margin: 6px 0 4px;
    color: var(--brand-deep);
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
}

.dashboard-metric-detail {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-card {
    padding: 18px;
    min-height: 260px;
}

.dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.dashboard-card-head h2 {
    margin: 4px 0 0 !important;
    color: var(--brand-deep) !important;
    font-size: 17px !important;
}

.dashboard-card-head > span {
    white-space: nowrap;
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 900;
}

.dashboard-line-chart {
    width: 100%;
    height: 250px;
    overflow: visible;
}

.chart-grid {
    stroke: #e6ebf2;
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: #1e2a78;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-dot {
    fill: #fff;
    stroke: #00bbd6;
    stroke-width: 3;
}

.chart-label {
    fill: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    height: 220px;
    align-items: end;
}

.dashboard-bar-item {
    display: grid;
    min-width: 0;
    grid-template-rows: 1fr auto auto;
    gap: 6px;
    text-align: center;
}

.dashboard-bar-track {
    display: flex;
    height: 150px;
    align-items: end;
    border-radius: 999px;
    background: #eef3f7;
    overflow: hidden;
}

.dashboard-bar-fill {
    width: 100%;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(180deg, #00bbd6, #1e2a78);
}

.dashboard-bar-item span,
.dashboard-bar-item strong {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-bar-item strong {
    color: var(--brand-deep);
}

.dashboard-doughnut-wrap {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 14px;
    align-items: center;
}

.dashboard-doughnut {
    width: 132px;
    height: 132px;
}

.dashboard-doughnut path,
.dashboard-doughnut-bg {
    fill: none;
    stroke-width: 13;
    stroke-linecap: round;
}

.dashboard-doughnut-bg {
    stroke: #eef3f7;
}

.dashboard-doughnut-total {
    fill: var(--brand-deep);
    font-size: 21px;
    font-weight: 900;
}

.dashboard-doughnut-caption {
    fill: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.dashboard-legend {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.dashboard-legend-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 8px;
    align-items: center;
}

.dashboard-legend-row span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.dashboard-legend-row p,
.dashboard-legend-row strong {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-legend-row strong {
    color: var(--brand-deep);
}

.dashboard-action-list,
.dashboard-stock-list,
.dashboard-client-list,
.dashboard-table {
    display: grid;
    gap: 10px;
}

.dashboard-action,
.dashboard-stock-item,
.dashboard-client-row,
.dashboard-table-row,
.dashboard-inventory > div {
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    background: #f8fafc;
}

.dashboard-action {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    padding: 12px;
}

.dashboard-action strong {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
}

.dashboard-action p,
.dashboard-action span {
    margin: 0;
    font-size: 12px;
}

.dashboard-action p {
    color: var(--brand-deep);
    font-weight: 900;
}

.dashboard-action span {
    color: var(--muted);
}

.dashboard-action-amber strong { background: #f59e0b; }
.dashboard-action-blue strong { background: #1e2a78; }
.dashboard-action-red strong { background: #ef4444; }
.dashboard-action-violet strong { background: #6366f1; }

.dashboard-inventory {
    display: grid;
    gap: 12px;
}

.dashboard-inventory > div {
    padding: 14px;
}

.dashboard-inventory span,
.dashboard-inventory small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-inventory strong {
    display: block;
    margin: 4px 0;
    color: var(--brand-deep);
    font-size: 23px;
    font-weight: 900;
}

.dashboard-table-row {
    display: grid;
    grid-template-columns: 76px minmax(160px, 1fr) auto 66px;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
}

.dashboard-ticket {
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 900;
}

.dashboard-table-row strong,
.dashboard-table-row small {
    display: block;
}

.dashboard-table-row strong {
    color: var(--brand-deep);
    font-size: 13px;
}

.dashboard-table-row small,
.dashboard-muted {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-status {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    border-radius: 999px;
    padding: 0 9px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 800;
}

.dashboard-stock-item,
.dashboard-client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
}

.dashboard-stock-item strong,
.dashboard-stock-item span,
.dashboard-client-row strong,
.dashboard-client-row span {
    display: block;
}

.dashboard-stock-item strong,
.dashboard-client-row strong {
    color: var(--brand-deep);
    font-size: 13px;
}

.dashboard-stock-item span,
.dashboard-client-row span {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-stock-item em,
.dashboard-client-row em {
    display: inline-flex;
    min-width: 36px;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #0d1333;
    background: #dffbff;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.dashboard-client-row {
    justify-content: flex-start;
}

.dashboard-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #00bbd6, #1e2a78);
    font-size: 13px;
    font-weight: 900;
}

.dashboard-client-row em {
    margin-left: auto;
    color: #166534;
    background: #dcfae6;
}

.dashboard-empty {
    display: grid;
    min-height: 84px;
    place-items: center;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    background: #f8fafc;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #edf1f5;
}

::-webkit-scrollbar-thumb {
    background: #b9c4d1;
    border-radius: 999px;
    border: 2px solid #edf1f5;
}

@media (max-width: 1023px) {
    .app-sidebar {
        width: 290px;
    }

    .app-header-inner {
        padding: 0 16px !important;
    }

    #main-content {
        padding: 18px 14px 28px !important;
    }

    #main-content h1 {
        font-size: 21px !important;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }

    .dashboard-grid-metrics,
    .dashboard-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-span-2 {
        grid-column: span 2;
    }

    .dashboard-table-row {
        grid-template-columns: 66px minmax(0, 1fr);
    }

    .dashboard-status,
    .dashboard-muted {
        justify-self: start;
    }
}

@media (max-width: 680px) {
    .dashboard-grid-metrics,
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-span-2 {
        grid-column: span 1;
    }

    .dashboard-hero-actions {
        width: 100%;
    }

    .dashboard-quick-btn,
    .dashboard-ghost-btn {
        flex: 1 1 150px;
    }

    .dashboard-card {
        min-height: auto;
        padding: 15px;
    }

    .dashboard-doughnut-wrap {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
    }

    .dashboard-legend {
        width: 100%;
    }

    .dashboard-bars {
        gap: 7px;
    }

    .dashboard-table-row {
        grid-template-columns: minmax(0, 1fr);
    }
}
