/* Inter mirrors the clean, table-first feel of shadcn-style admin surfaces. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --color-primary: #F05B24;
    --color-primary-hover: #D94E1E;
    --color-secondary: #1E2140;
    
    /* Light Mode Variables (Default) */
    --bg-body: #fbfbfa;
    --bg-card: #ffffff;
    --bg-surface-alt: #fafafa;
    --bg-sidebar: #ffffff;
    --bg-hover: #f7f7f6;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: rgba(17, 24, 39, 0.08);
    
    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #ea580c;
    
    --shadow-sm: none;
    --shadow-md: 0 8px 20px -18px rgba(17, 24, 39, 0.35);
    --border-radius: 8px;
    --transition: all 0.18s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #171717;
    --bg-card: #1d1d1d;
    --bg-sidebar: #1d1d1d;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-muted: #92929f;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 10px 24px -16px rgba(0,0,0,0.55);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: var(--transition);
    overflow-x: hidden;
}

body.admin-nav-open {
    overflow: hidden;
}

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

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar-overlay {
    background: rgba(17, 24, 39, 0.46);
    border: 0;
    cursor: pointer;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.18s ease;
    z-index: 998;
}

.sidebar-overlay[hidden] {
    display: none;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background-color: #fff;
    border-radius: 999px;
    border: 2px solid rgba(240, 91, 36, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
}

.menu-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 15px 24px 8px;
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    gap: 12px;
    position: relative;
    font-size: 14px;
}

.menu-item i {
    font-size: 20px;
}

.menu-item:hover {
    color: var(--text-main);
    background-color: var(--bg-hover);
}

.menu-item.active {
    color: var(--color-primary);
    background-color: rgba(255, 119, 0, 0.1);
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--color-primary);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.menu-badge {
    margin-left: auto;
    background-color: var(--bg-body);
    color: var(--color-primary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

.menu-item.active .menu-badge {
    background-color: var(--color-primary);
    color: white;
}

.menu-group {
    margin-bottom: 4px;
}

.menu-submenu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0 10px 50px;
}

.menu-subitem {
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    margin-right: 12px;
    transition: var(--transition);
}

.menu-subitem:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.menu-subitem.active {
    color: var(--color-primary);
    background-color: rgba(255, 119, 0, 0.12);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.top-navbar {
    height: 64px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.breadcrumb span {
    color: var(--color-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
    width: 200px;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

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

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

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    font-size: 18px;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.mobile-sidebar-toggle {
    display: none;
    flex-shrink: 0;
}

/* Dashboard Content */
.content-wrapper {
    padding: 14px;
}

/* Stat Cards */
.stat-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 9px;
}

.stat-title {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.stat-value.text-success { color: var(--color-success); }
.stat-value.text-primary { color: var(--color-primary); }

.stat-change {
    font-size: 13px;
    color: var(--text-muted);
}
.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--color-danger); }

/* Dashboard Grid */
.dashboard-grid {
    align-items: start;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    min-width: 0;
}

.dashboard-chart-grid {
    margin-bottom: 20px;
}

.dashboard-panel-header {
    gap: 12px;
}

.dashboard-chart-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.dashboard-chart-controls .tab-btn {
    font-size: 12px;
    min-height: 32px;
    padding: 5px 12px;
}

.dashboard-chart-frame {
    height: 280px;
    min-height: 220px;
    min-width: 0;
    overflow: hidden;
    padding: 20px;
    position: relative;
}

.dashboard-chart-frame canvas {
    display: block;
    max-width: 100%;
}

.dashboard-status-panel {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    padding: 20px;
}

.dashboard-donut-frame {
    height: 200px;
    max-width: 100%;
    position: relative;
    width: 200px;
}

.dashboard-status-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.dashboard-status-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
}

.dashboard-status-label {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: 13px;
    gap: 8px;
    min-width: 0;
}

.dashboard-status-dot {
    border-radius: 999px;
    flex-shrink: 0;
    height: 10px;
    width: 10px;
}

.dashboard-status-text,
.dashboard-performance-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-status-value {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.dashboard-title-with-icon {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    min-width: 0;
}

.dashboard-panel-meta {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.dashboard-performance-list {
    padding: 0;
}

.dashboard-performance-item {
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    min-width: 0;
    padding: 14px 20px;
}

.dashboard-performance-item:last-child {
    border-bottom: 0;
}

.dashboard-rank {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    width: 20px;
}

.dashboard-rank.is-top {
    color: var(--color-warning);
}

.dashboard-driver-avatar {
    align-items: center;
    background: var(--color-primary);
    border-radius: 50%;
    color: white;
    display: flex;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.dashboard-performance-content {
    flex: 1;
    min-width: 0;
}

.dashboard-performance-main {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 5px;
    min-width: 0;
}

.dashboard-performance-name {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

.dashboard-performance-metric {
    color: var(--color-primary);
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.dashboard-performance-sub {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.dashboard-progress-track {
    background: var(--bg-body);
    border-radius: 4px;
    flex: 1;
    height: 5px;
    min-width: 0;
    overflow: hidden;
}

.dashboard-progress-fill {
    background: var(--color-primary);
    border-radius: 4px;
    height: 100%;
}

.dashboard-performance-count {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 12px;
    white-space: nowrap;
}

/* Panel/Card General */
.panel {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
}

.panel-link {
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
}

.panel-link:hover {
    text-decoration: underline;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

.td-id {
    color: var(--text-muted);
    font-size: 13px;
}

.td-user, .td-resto {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Keep table layout stable when these helpers are applied directly on <td>. */
td.td-user,
td.td-resto {
    display: table-cell;
}

td.td-user .td-strong,
td.td-user .td-sub,
td.td-resto .td-strong,
td.td-resto .td-sub {
    display: block;
}

.td-strong {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13px;
}

.td-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.td-price {
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

/* Badges */
.badge {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-warning { background-color: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.badge-warning::before { background-color: var(--color-warning); }

.badge-success { background-color: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.badge-success::before { background-color: var(--color-success); }

.badge-danger { background-color: rgba(239, 68, 68, 0.1); color: var(--color-danger); }
.badge-danger::before { background-color: var(--color-danger); }

/* Driver List */
.driver-list {
    padding: 10px 0;
}

.driver-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}
.driver-item:last-child {
    border-bottom: none;
}

.driver-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-primary);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.driver-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.driver-avatar-fallback {
    display: inline-flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.driver-avatar.has-image .driver-avatar-fallback {
    display: none;
}

.admin-thumbnail {
    align-items: center;
    background: rgba(240, 91, 36, 0.1);
    color: var(--color-primary);
    display: flex;
    flex-shrink: 0;
    height: 48px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 56px;
}

.restaurant-thumbnail {
    border-radius: 9px;
}

.admin-thumbnail-image {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.admin-thumbnail-fallback {
    align-items: center;
    display: inline-flex;
    font-size: 22px;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.admin-thumbnail.has-image .admin-thumbnail-fallback {
    display: none;
}

.driver-avatar.sari { background-color: #f97316; }
.driver-avatar.agus { background-color: #ea580c; }
.driver-avatar.rendi { background-color: #a16207; }

.driver-info {
    flex: 1;
}

/* Login Page */
.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background-color: var(--bg-body);
    padding: clamp(24px, 5vw, 56px);
}

.auth-shell {
    align-items: center;
    display: grid;
    gap: clamp(28px, 5vw, 56px);
    grid-template-columns: minmax(0, 1fr) 1px minmax(320px, 0.86fr);
    max-width: 940px;
    width: 100%;
}

.auth-brand-panel {
    align-items: center;
    display: flex;
    gap: 24px;
    min-width: 0;
}

.auth-brand-logo {
    background: #ffffff;
    border: 2px solid rgba(240, 91, 36, 0.24);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    height: 124px;
    object-fit: cover;
    width: 124px;
}

.auth-brand-copy {
    min-width: 0;
}

.auth-brand-copy span {
    color: var(--color-primary);
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-brand-copy h1 {
    color: var(--text-main);
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.05;
    margin: 0;
}

.auth-brand-copy p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 12px;
    max-width: 300px;
}

.auth-divider {
    align-self: stretch;
    background: var(--border-color);
    min-height: 360px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-logo {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 28px;
}

.auth-logo span {
    color: var(--text-main);
    font-size: 28px;
    font-weight: 800;
}

.auth-logo small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-footnote {
    margin-top: 24px;
    text-align: center;
}

.auth-footnote p {
    color: var(--text-muted);
    font-size: 13px;
}

.auth-theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    justify-content: center;
    margin: 15px auto 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 119, 0, 0.1);
}

.password-field {
    display: block;
    position: relative;
    width: 100%;
}

.password-field .form-control {
    padding-right: 48px;
}

.password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
    width: 36px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(255, 119, 0, 0.08);
    color: var(--color-primary);
}

.password-toggle:focus-visible {
    outline: 2px solid rgba(255, 119, 0, 0.35);
    outline-offset: 2px;
}

.password-toggle i {
    font-size: 20px;
    line-height: 1;
}

.form-error {
    color: var(--color-danger);
    font-size: 13px;
    line-height: 1.4;
    margin-top: 6px;
}

.form-help {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    line-height: 1.45;
    margin-top: 8px;
}

.restaurant-banner-preview {
    align-items: center;
    aspect-ratio: 4 / 3;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.restaurant-banner-preview img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.restaurant-banner-placeholder {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.restaurant-banner-placeholder i {
    font-size: 24px;
}

.restaurant-banner-preview.has-image .restaurant-banner-placeholder {
    display: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 16px;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    overflow: hidden;
    position: relative;
}

.user-avatar img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.user-avatar.has-image i {
    display: none;
}

.user-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-top: 10px;
    overflow-x: auto;
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.tab-btn.active .badge {
    background: white;
    color: var(--color-primary);
}

/* Badge Updates */
.badge-info { 
    background-color: rgba(234, 88, 12, 0.1); 
    color: var(--color-info); 
}
.badge-info::before { background-color: var(--color-info); }

/* Action Buttons in Table */
.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.btn-action.detail {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}
.btn-action.detail:hover { background: rgba(107, 114, 128, 0.2); color: var(--text-main); }

.btn-action.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}
.btn-action.warning:hover { background: rgba(245, 158, 11, 0.2); }

.btn-action.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}
.btn-action.danger:hover { background: rgba(239, 68, 68, 0.2); }

.customer-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.customer-actions form {
    margin: 0;
}

.customer-detail-row[hidden] {
    display: none;
}

.customer-detail-row td {
    background: var(--bg-body);
    padding: 0;
}

.customer-detail-panel {
    border-top: 1px solid var(--border-color);
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 14px 18px;
}

.customer-detail-profile {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 180px;
}

.customer-detail-profile strong {
    color: var(--text-main);
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.customer-detail-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-detail-grid strong {
    color: var(--text-main);
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.customer-detail-actions {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* Pagination Controls */
.btn-page {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

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

.btn-page.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Compact admin polish */
.sidebar-header {
    padding: 18px 20px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.sidebar-brand small {
    color: var(--text-muted);
    font-size: 10px;
    margin-top: 3px;
}

.menu-category,
th {
    letter-spacing: 0;
}

.menu-category {
    padding: 12px 20px 6px;
}

.menu-item {
    padding: 9px 20px;
    font-size: 14px;
}

.menu-item.active::before {
    width: 3px;
}

.menu-badge {
    border-radius: 999px;
    padding: 2px 7px;
}

.menu-badge.is-muted {
    background: transparent;
    color: var(--color-success);
}

.menu-badge.is-warning {
    background: var(--color-warning);
    color: white;
}

.menu-submenu {
    gap: 2px;
    margin: 4px 0 8px 48px;
}

.menu-subitem {
    justify-content: space-between;
    border-radius: 7px;
    padding: 6px 9px;
}

.menu-subitem span {
    color: var(--text-muted);
    font-size: 11px;
}

.sidebar-footer {
    padding: 14px 20px;
}

.logout-form {
    margin-left: auto;
}

.icon-btn.is-danger {
    color: var(--color-danger);
}

.top-navbar {
    height: 56px;
    padding: 0 18px;
}

.content-wrapper {
    padding: 14px;
}

.stat-cards-wrapper,
.dashboard-grid,
.detail-grid {
    gap: 10px;
}

.stat-cards-wrapper {
    margin-bottom: 10px;
}

.dashboard-grid {
    margin-bottom: 10px;
}

.stat-card,
.panel {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    padding: 12px;
}

.stat-card-header {
    margin-bottom: 10px;
}

.panel-header {
    padding: 12px 14px;
}

.panel-header.stack {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
}

.panel-description {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
}

.toolbar-row,
.page-actions,
.badge-row,
.panel-pagination,
.pagination-controls {
    align-items: center;
    display: flex;
}

.toolbar-row,
.page-actions,
.panel-pagination {
    justify-content: space-between;
}

.toolbar-row,
.page-actions {
    gap: 10px;
}

/* Search-bar di bawah ini memakai width:100%, jadi tanpa flex-shrink:0 ia akan
   mengompres tombol di sebelahnya sampai teksnya membungkus dua baris.
   Di bawah 760px aturan ini ditimpa width:100% !important, jadi tetap responsif. */
.toolbar-row > .btn,
.page-actions .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.badge-row,
.pagination-controls {
    gap: 8px;
}

.search-bar {
    min-height: 36px;
    padding: 6px 11px;
}

.toolbar-row .search-bar {
    max-width: 380px;
    width: 100%;
}

.compact-tabs {
    border-bottom: 0;
    margin-top: 0;
    padding-bottom: 0;
}

.compact-tabs .tab-btn {
    border-radius: 8px;
    gap: 7px;
    padding: 6px 10px;
}

.compact-tabs .badge {
    padding: 2px 7px;
}

th {
    font-size: 11px;
    padding: 8px 12px;
}

td {
    padding: 12px 14px;
}

tbody tr:hover {
    background: color-mix(in srgb, var(--bg-hover) 55%, transparent);
}

.td-strong,
.td-sub {
    display: block;
}

.td-action {
    text-align: right;
    width: 72px;
}

.td-action .btn-action {
    margin-left: auto;
}

.row-note {
    margin-top: 5px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 13px;
    padding: 18px;
    text-align: center;
}

.panel-pagination {
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    padding: 14px 16px;
}

.btn-page.disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.btn-muted {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.16);
}

.alert {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.22);
    color: var(--color-success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.22);
    color: var(--color-danger);
}

.notification-menu {
    position: relative;
}

.notification-dot {
    background: var(--color-primary);
    border: 2px solid var(--bg-sidebar);
    border-radius: 999px;
    height: 10px;
    position: absolute;
    right: 8px;
    top: 8px;
    width: 10px;
}

.notification-dot.is-hidden {
    display: none;
}

.notification-dropdown {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    min-width: 320px;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 44px;
    z-index: 200;
}

.notification-header {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 14px;
}

.notification-title {
    display: block;
    font-size: 14px;
    font-weight: 800;
}

.notification-header small {
    color: var(--text-muted);
    font-size: 12px;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 6px;
}

.notification-item {
    align-items: flex-start;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 10px;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-icon {
    align-items: center;
    background: rgba(240, 91, 36, 0.1);
    border-radius: 8px;
    color: var(--color-primary);
    display: inline-flex;
    flex-shrink: 0;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.notification-item small,
.notification-item em {
    color: var(--text-muted);
    display: block;
    font-size: 11px;
    font-style: normal;
}

.notification-item strong {
    color: var(--text-main);
    display: block;
    font-size: 13px;
    margin: 2px 0;
}

.notification-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 18px 12px;
    text-align: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    margin-bottom: 12px;
}

.detail-grid.secondary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.summary-grid,
.settings-form-grid {
    display: grid;
    gap: 12px;
    padding: 16px;
}

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

.summary-grid span,
.info-list span,
.settings-row span {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
}

.summary-grid strong,
.info-list strong,
.settings-row strong {
    color: var(--text-main);
    display: block;
    font-size: 14px;
    margin-top: 4px;
}

.summary-grid small {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.text-primary {
    color: var(--color-primary) !important;
}

.text-success {
    color: var(--color-success) !important;
}

.text-warning {
    color: var(--color-warning) !important;
}

.text-danger {
    color: var(--color-danger) !important;
}

.proof-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.proof-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
    padding: 14px;
    background: color-mix(in srgb, var(--bg-card) 96%, var(--bg-body));
    align-items: start;
}

.proof-thumb {
    aspect-ratio: 4 / 3;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: block;
    overflow: hidden;
}

.proof-thumb img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.proof-content {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.proof-content.has-actions {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    align-items: start;
}

.proof-details {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.proof-customer {
    color: var(--text-main);
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.proof-note {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.proof-content small {
    color: var(--text-muted);
    font-size: 12px;
}

.proof-meta {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
}

.proof-meta small {
    line-height: 1.7;
    white-space: nowrap;
}

.proof-actions {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 10px;
}

.proof-actions form {
    margin: 0;
}

.approve-form .btn,
.reject-form .btn {
    justify-content: center;
    min-height: 40px;
    width: 100%;
}

.reject-form {
    display: grid;
    gap: 8px;
}

.reject-form label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.reject-form textarea.form-control {
    line-height: 1.4;
    min-height: 76px;
    padding: 10px 12px;
    resize: vertical;
}

.info-list,
.settings-list,
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}

.info-list > div,
.settings-row {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.info-list > div:last-child,
.settings-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.timeline-item {
    align-items: flex-start;
    display: flex;
    gap: 10px;
}

.timeline-dot {
    background: var(--color-primary);
    border-radius: 999px;
    flex-shrink: 0;
    height: 8px;
    margin-top: 7px;
    width: 8px;
}

.timeline-item strong,
.timeline-item p,
.timeline-item small {
    display: block;
}

.timeline-item p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin-top: 4px;
}

.timeline-item small {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.timeline-list.horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-overview-panel {
    width: 100%;
}

.settings-overview {
    display: grid;
    gap: 0;
}

.settings-section {
    border-top: 1px solid var(--border-color);
    padding: 14px 16px 16px;
}

.settings-section-title {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.settings-section-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.settings-section-header .settings-section-title {
    margin-bottom: 0;
}

.settings-section-note {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    margin-top: 5px;
}

.settings-metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.setting-metric {
    min-width: 0;
}

.setting-metric span,
.setting-metric small {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
}

.setting-metric strong {
    color: var(--text-main);
    display: block;
    font-size: 18px;
    margin-top: 5px;
}

.setting-metric small {
    line-height: 1.45;
    margin-top: 5px;
}

.settings-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.settings-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-list-grid .settings-row {
    border-bottom: 0;
    border-right: 1px solid var(--border-color);
    padding: 2px 14px 2px 0;
}

.settings-list-grid .settings-row:last-child {
    border-right: 0;
    padding-right: 0;
}

.settings-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qris-settings-grid {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
}

.qris-preview-frame {
    aspect-ratio: 3 / 4;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: block;
    max-width: 240px;
    overflow: hidden;
    padding: 8px;
    width: 100%;
}

.qris-preview-frame img {
    border-radius: 6px;
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.qris-settings-content {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.qris-meta-list.settings-list,
.qris-upload-form {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.qris-meta-list .settings-row {
    align-items: flex-start;
    gap: 12px;
}

.qris-meta-list .settings-row strong {
    max-width: 70%;
    overflow-wrap: anywhere;
    text-align: right;
}

.qris-file-input {
    min-height: 44px;
}

.form-control[readonly],
.form-control:disabled {
    cursor: default;
    opacity: 0.78;
}

.compact-table td {
    font-size: 13px;
}

@media (max-width: 1200px) {
    .stat-cards-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .detail-grid,
    .detail-grid.secondary {
        grid-template-columns: 1fr;
    }

    .settings-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

    .sidebar {
        box-shadow: 18px 0 38px -28px rgba(17, 24, 39, 0.65);
        height: 100dvh;
        left: 0;
        max-width: 320px;
        position: fixed;
        top: 0;
        transform: translateX(-100%);
        width: min(86vw, 320px);
        z-index: 1000;
    }

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

    .admin-layout.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-menu {
        max-height: none;
    }

    .main-content {
        margin-left: 0;
        min-width: 0;
    }

    .mobile-sidebar-toggle {
        display: inline-flex;
    }

    .top-navbar {
        gap: 10px;
        height: auto;
        min-height: 56px;
        padding: 8px 12px;
    }

    .breadcrumb {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-actions {
        flex-shrink: 0;
    }

    .settings-list-grid {
        grid-template-columns: 1fr;
    }

    .settings-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-list-grid .settings-row {
        border-bottom: 1px solid var(--border-color);
        border-right: 0;
        padding: 0 0 10px;
    }

    .settings-list-grid .settings-row:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .customer-detail-panel {
        grid-template-columns: 1fr;
    }

    .customer-detail-profile {
        min-width: 0;
    }

    .customer-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-detail-actions {
        align-items: flex-start;
    }

    .toolbar-row,
    .page-actions,
    .panel-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-row .search-bar {
        max-width: none;
    }

    .summary-grid,
    .settings-form-grid {
        grid-template-columns: 1fr;
    }

    .proof-content.has-actions {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .auth-divider {
        display: none;
    }

    .auth-brand-panel {
        justify-content: center;
        text-align: center;
    }

    .auth-brand-copy p {
        margin-left: auto;
        margin-right: auto;
    }

    .auth-card {
        max-width: none;
    }

    .qris-settings-grid {
        grid-template-columns: 1fr;
    }

    .qris-preview-frame {
        max-width: 280px;
    }

    .qris-meta-list .settings-row strong {
        max-width: 100%;
        text-align: left;
    }
}

@media (max-width: 760px) {
    .panel-header {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .panel-header > *,
    .toolbar-row > *,
    .page-actions > * {
        min-width: 0;
    }

    .panel-header [style*="display: flex"],
    .toolbar-row,
    .page-actions,
    .badge-row {
        flex-wrap: wrap;
    }

    .panel-header .btn,
    .toolbar-row .btn,
    .page-actions .btn,
    .toolbar-row .search-bar,
    .page-actions .search-bar {
        justify-content: center;
        width: 100% !important;
    }

    .search-bar {
        min-height: 44px;
        width: 100% !important;
    }

    .search-bar input {
        min-width: 0;
        width: 100% !important;
    }

    .tabs {
        margin-left: -2px;
        padding-bottom: 4px;
    }

    .tab-btn {
        min-height: 40px;
    }

    .btn,
    .icon-btn,
    .btn-action,
    .btn-page {
        min-height: 44px;
    }

    .btn {
        justify-content: center;
        padding: 10px 14px;
    }

    .btn-action {
        min-width: 44px;
        width: 44px;
    }

    .table-responsive {
        overflow: visible;
    }

    table.orders-table {
        min-width: 0;
    }

    .orders-table thead {
        display: none;
    }

    .orders-table,
    .orders-table tbody,
    .orders-table tr,
    .orders-table td {
        display: block;
        width: 100%;
    }

    .orders-table tbody {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .orders-table tr {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
        padding: 10px 12px;
    }

    .orders-table tr:hover {
        background: var(--bg-card);
    }

    .orders-table td {
        border-bottom: 0;
        padding: 8px 0;
    }

    .orders-table td[data-label] {
        min-height: 34px;
        padding-left: min(128px, 38%);
        position: relative;
    }

    .orders-table td[data-label]::before {
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 800;
        left: 0;
        line-height: 1.35;
        padding-top: 2px;
        position: absolute;
        top: 8px;
        text-transform: uppercase;
        width: min(112px, 34%);
    }

    .orders-table td.mobile-card-primary,
    .orders-table td.td-action {
        display: block;
        padding-left: 0;
    }

    .orders-table td.mobile-card-primary::before,
    .orders-table td.td-action::before {
        display: block;
        margin-bottom: 8px;
        position: static;
        width: auto;
    }

    .orders-table td.td-action {
        text-align: left;
        width: auto;
    }

    .td-action .btn-action {
        margin-left: 0;
    }

    td.td-user,
    td.td-resto {
        display: block;
    }

    .customer-actions,
    .orders-table td.td-action > div {
        justify-content: flex-start !important;
    }

    .orders-table td[colspan],
    .orders-table .empty-state {
        display: block;
        padding: 18px 12px;
        text-align: center;
    }

    .customer-detail-row {
        margin-top: -10px;
    }

    .customer-detail-row td {
        padding: 0;
    }

    .customer-detail-panel {
        border-top: 0;
        padding: 14px;
    }

    .dashboard-grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-grid {
        margin-bottom: 10px;
    }

    .dashboard-panel-header {
        align-items: flex-start !important;
    }

    .dashboard-chart-controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
        width: 100%;
    }

    .dashboard-chart-controls .tab-btn {
        justify-content: center;
        min-width: 0;
        padding: 7px 8px;
    }

    .dashboard-chart-frame {
        height: 240px;
        min-height: 220px;
        padding: 14px;
    }

    .dashboard-status-panel {
        align-items: stretch;
        padding: 14px;
    }

    .dashboard-donut-frame {
        height: min(190px, 58vw);
        margin: 0 auto;
        width: min(190px, 58vw);
    }

    .dashboard-status-row {
        align-items: flex-start;
    }

    .dashboard-status-value {
        max-width: 45%;
    }

    .dashboard-title-with-icon {
        align-items: flex-start;
        line-height: 1.35;
    }

    .dashboard-panel-meta {
        white-space: normal;
    }

    .dashboard-performance-item {
        align-items: flex-start;
        padding: 14px;
    }

    .dashboard-performance-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .dashboard-performance-name,
    .dashboard-performance-metric,
    .dashboard-status-text {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .dashboard-performance-metric {
        text-align: left;
    }

    .dashboard-performance-sub {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .dashboard-progress-track {
        flex: none;
        width: 100%;
    }

    .dashboard-performance-count {
        white-space: normal;
    }

    form [style*="grid-template-columns:repeat(2"],
    form [style*="grid-template-columns: repeat(2"],
    form [style*="grid-template-columns:minmax(0, 180px)"],
    form [style*="grid-template-columns: minmax(0, 180px)"],
    form [style*="grid-template-columns:repeat(auto-fit"],
    form [style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }

    form [style*="grid-column: span 2"] {
        grid-column: auto !important;
    }

    form [style*="justify-content:flex-end"],
    form [style*="justify-content: flex-end"] {
        align-items: stretch !important;
        flex-direction: column-reverse !important;
    }

    form [style*="justify-content:flex-end"] .btn,
    form [style*="justify-content: flex-end"] .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .content-wrapper {
        padding: 10px;
    }

    .sidebar-header {
        padding: 16px;
    }

    .sidebar-footer {
        padding: 14px 16px;
    }

    .stat-value {
        font-size: 22px;
        overflow-wrap: anywhere;
    }

    .dashboard-chart-controls {
        gap: 6px;
    }

    .dashboard-chart-controls .tab-btn {
        font-size: 11.5px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .dashboard-chart-frame {
        height: 220px;
        padding: 10px;
    }

    .dashboard-status-panel {
        gap: 14px;
    }

    .dashboard-performance-item {
        gap: 12px;
        padding: 12px;
    }

    .stat-cards-wrapper {
        grid-template-columns: 1fr;
    }

    .proof-item {
        grid-template-columns: 1fr;
    }

    .proof-thumb {
        max-width: 260px;
        width: 100%;
    }

    .customer-detail-grid {
        grid-template-columns: 1fr;
    }

    .settings-metric-grid {
        grid-template-columns: 1fr;
    }

    .settings-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-brand-panel {
        flex-direction: column;
    }

    .auth-brand-logo {
        height: 92px;
        width: 92px;
    }

    .form-control,
    .search-bar input,
    select,
    textarea {
        font-size: 16px;
    }

    .notification-dropdown {
        left: 12px;
        max-height: calc(100dvh - 76px);
        min-width: 0;
        position: fixed;
        right: 12px;
        top: 64px;
        width: auto;
    }

    .notification-list {
        max-height: calc(100dvh - 160px);
    }

    .panel-pagination {
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        text-align: center;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .qris-preview-frame {
        margin: 0 auto;
    }

    .proof-meta {
        flex-direction: column;
        gap: 8px;
    }

    .proof-meta small {
        white-space: normal;
    }

    #menu-edit-modal {
        align-items: flex-end !important;
        padding: 10px !important;
    }

    #menu-edit-modal > div {
        border-radius: 12px 12px 0 0 !important;
        max-height: 88dvh !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
