:root {
    --color-bg: #0f1624;
    --color-bg-soft: #151e32;
    --color-surface: #1f2a40;
    --color-accent: #4cc9f0;
    --color-accent-strong: #4361ee;
    --color-text: #f7faff;
    --color-text-muted: #9aa7c0;
    --color-danger: #ff6b6b;
    --sidebar-width: 280px;
    --sidebar-width-collapsed: 88px;
    --border-radius: 16px;
    --shadow-soft: 0 20px 45px -35px rgba(15, 22, 36, 0.6);
    --shadow-hard: 0 24px 60px -32px rgba(67, 97, 238, 0.35);
    --control-height: 44px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    background: radial-gradient(circle at top, #18233a 0%, #0c1220 35%, #070b14 100%);
    color: var(--color-text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 20px;
    background: rgba(15, 18, 27, 0.72);
    backdrop-filter: blur(22px);
    border-right: 1px solid rgba(118, 131, 160, 0.08);
    display: flex;
    flex-direction: column;
    gap: 28px;
    transition: width 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.sidebar-title {
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.sidebar-toggle {
    margin-left: auto;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    width: var(--control-height);
    height: var(--control-height);
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--color-text-muted);
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar-link .material-symbols-rounded {
    font-size: 22px;
}

.sidebar-link:hover {
    background: rgba(76, 201, 240, 0.08);
    color: var(--color-text);
    transform: translateX(4px);
}

.sidebar-link.is-active {
    background: linear-gradient(120deg, rgba(76, 201, 240, 0.2), rgba(67, 97, 238, 0.22));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(76, 201, 240, 0.35);
}

.sidebar-link.is-danger {
    margin-top: 12px;
    background: rgba(255, 107, 107, 0.08);
    color: #ffc9c9;
}

.sidebar-link.is-danger:hover {
    background: rgba(255, 107, 107, 0.18);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(31, 42, 64, 0.6);
}

.app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    padding: 24px 32px 12px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.topbar-menu {
    display: none;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    width: var(--control-height);
    height: var(--control-height);
    border-radius: 14px;
    color: var(--color-text);
}

.topbar-title h1 {
    font-size: 1.6rem;
    font-weight: 600;
}

.topbar-title p {
    margin-top: 4px;
    color: var(--color-text-muted);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 0 16px;
    min-height: var(--control-height);
    min-width: 260px;
}

.topbar-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text);
    font-size: 0.95rem;
    height: 100%;
}

.topbar-icon {
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    width: var(--control-height);
    height: var(--control-height);
    border-radius: 14px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.app-content {
    flex: 1;
    padding: 12px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background: rgba(20, 28, 46, 0.78);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-accent {
    border-color: rgba(76, 201, 240, 0.25);
    box-shadow: var(--shadow-hard);
}

.card h2 {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card span.metric {
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
}

.card small {
    color: var(--color-text-muted);
}

.table-card {
    background: rgba(17, 24, 39, 0.82);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.table-card header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card th,
.table-card td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    text-align: left;
    color: var(--color-text);
    vertical-align: middle;
}

.table-card tbody tr:hover {
    background: rgba(76, 201, 240, 0.06);
}

.tag {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(67, 97, 238, 0.15);
    color: #9cbcff;
}

.badge-success {
    background: rgba(100, 221, 170, 0.18);
    color: #9ff6cf;
}

.badge-warning {
    background: rgba(255, 203, 107, 0.18);
    color: #ffdd99;
}

.badge-danger {
    background: rgba(255, 107, 107, 0.18);
    color: #ffc9c9;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: var(--control-height);
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(120deg, rgba(76, 201, 240, 0.65), rgba(67, 97, 238, 0.75));
    color: #fff;
    box-shadow: var(--shadow-hard);
}

.btn-primary:hover {
    transform: translateY(-2px);
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: var(--sidebar-width-collapsed) 1fr;
    }

    .app-sidebar {
        width: var(--sidebar-width-collapsed);
        padding: 24px 18px;
    }

    .app-sidebar[data-collapsed="true"] .sidebar-link span + span,
    .app-sidebar[data-collapsed="true"] .sidebar-title,
    .app-sidebar[data-collapsed="true"] .sidebar-subtitle,
    .app-sidebar[data-collapsed="true"] .sidebar-footer,
    .app-sidebar[data-collapsed="true"] .sidebar-toggle {
        display: none;
    }

    .app-sidebar[data-collapsed="true"] {
        align-items: center;
    }

    .app-sidebar[data-collapsed="true"] .sidebar-link {
        justify-content: center;
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(78vw, 320px);
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: 0 0 0 999px rgba(3, 9, 20, 0.55);
    }

    .app-sidebar[data-open="true"] {
        transform: translateX(0);
    }

    .topbar-menu {
        display: grid;
    }
}

.table-responsive {
    overflow-x: auto;
}

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-toolbar input[type="search"],
.table-toolbar select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0 12px;
    color: var(--color-text);
    outline: none;
    min-height: var(--control-height);
}

.table-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
}

.table-pagination button {
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    border: none;
    border-radius: 10px;
    padding: 6px 12px;
    cursor: pointer;
}

.table-pagination button.is-active {
    background: rgba(76, 201, 240, 0.18);
    color: #fff;
}

.tag-small {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.status-dot {
    width: 10px;
    height: 10px;
    display: inline-flex;
    border-radius: 50%;
    margin-right: 8px;
    background: rgba(156, 191, 255, 0.6);
}

.status-dot--success {
    background: #90f2b0;
}

.status-dot--warning {
    background: #ffd479;
}

.status-dot--danger {
    background: #ff8c8c;
}

.badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 500;
    color: var(--color-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="file"],
select,
textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--color-text);
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    min-height: var(--control-height);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(76, 201, 240, 0.35);
    box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

summary.btn {
    list-style: none;
}

summary.btn::-webkit-details-marker {
    display: none;
}

summary.btn {
    cursor: pointer;
}
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.analysis-card {
    background: rgba(18, 24, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-soft);
}

.analysis-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.analysis-card header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.analysis-card header .metric {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
}

.analysis-list {
    background: rgba(10, 15, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.analysis-download {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 720px) {
    .analysis-list {
        max-height: 180px;
    }
}
select,
select option {
    color: #111 !important;
    background-color: #f5f7fa;
}

select {
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.status-tab.is-active {
    background: linear-gradient(120deg, rgba(76, 201, 240, 0.25), rgba(67, 97, 238, 0.3));
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-hard);
}

.order-section {
    display: none;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.order-card {
    background: rgba(18, 24, 40, 0.85);
    border-radius: 20px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-soft);
}

.order-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.order-card header h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.order-meta {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

.order-lines {
    background: rgba(10, 15, 28, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    overflow: hidden;
}

.order-lines table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.order-lines th,
.order-lines td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.order-lines tbody tr:last-child td {
    border-bottom: none;
}

.order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.order-action-form {
    background: rgba(10, 15, 28, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 220px;
}

.order-action-form input[type="url"] {
    width: 100%;
}

.order-tracking ul {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 0.85rem;
}

.order-note {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 12px;
}

@media (max-width: 680px) {
    .order-grid {
        grid-template-columns: 1fr;
    }
}
/* =============================
   Responsive Enhancements
   ============================= */
@media (max-width: 1024px) {
    html {
        font-size: 14px;
    }

    .app-topbar {
        padding: 20px 24px 12px;
        gap: 18px;
    }

    .topbar-title h1 {
        font-size: 1.4rem;
    }

    .topbar-title p {
        font-size: 0.9rem;
    }

    .table-card header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 860px) {
    .app-content {
        padding: 16px 22px 28px;
        gap: 18px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .app-topbar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .topbar-title {
        order: 2;
        width: 100%;
    }

    .topbar-actions {
        order: 3;
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
    }

    .topbar-search {
        order: 1;
        width: 100%;
        min-width: 0;
        padding: 10px 14px;
    }

    .topbar-actions .topbar-icon,
    .topbar-menu {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .table-toolbar {
        flex-wrap: wrap;
        align-items: stretch;
        width: 100%;
    }

    .table-toolbar > * {
        flex: 1 1 180px;
    }

    .table-pagination {
        justify-content: center;
        padding: 14px 18px;
    }
}

@media (max-width: 620px) {
    .app-topbar {
        padding: 16px 18px 10px;
        gap: 14px;
    }

    .topbar-title h1 {
        font-size: 1.25rem;
    }

    .app-content {
        padding: 14px 16px 24px;
    }

    .cards-grid,
    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card,
    .analysis-card {
        padding: 20px;
    }

    .btn {
        padding: 10px 16px;
    }

    .table-card header {
        padding: 16px 18px;
    }

    .table-card th,
    .table-card td {
        padding: 14px 18px;
        font-size: 0.92rem;
    }

    .table-toolbar > * {
        flex: 1 1 100%;
        width: 100%;
    }

    label {
        width: 100%;
    }

    .table-responsive {
        margin: 0 -6px;
        padding: 0 6px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13.5px;
    }

    .app-content {
        padding: 12px 14px 22px;
        gap: 16px;
    }

    .topbar-menu,
    .topbar-actions .topbar-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .topbar-search {
        padding: 8px 12px;
    }

    .topbar-search input {
        font-size: 0.9rem;
    }

    .card span.metric {
        font-size: 1.8rem;
    }

    .table-card th,
    .table-card td {
        padding: 12px 14px;
    }

    .table-pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .table-pagination button {
        flex: 1 1 40px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .sidebar-link {
        gap: 12px;
        padding: 10px 12px;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 13px;
    }

    .app-topbar {
        padding: 14px 12px 10px;
    }

    .app-content {
        padding: 10px 12px 18px;
    }

    .card,
    .analysis-card,
    .table-card header {
        padding: 16px;
    }

    .table-card th,
    .table-card td {
        padding: 12px;
    }

    .table-toolbar {
        gap: 10px;
    }

    .table-toolbar > * {
        flex: 1 1 100%;
        min-width: 100%;
    }
}
