/* Admin Layout */
:root {
    --gt-admin-header-height: 4.25rem;
}

body.admin-page {
    overflow: hidden;
    height: 100vh;
}

.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.admin-sidebar {
    width: 260px;
    background: var(--gt-sidebar-bg);
    color: var(--gt-sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width var(--gt-transition);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 1030;
}

.admin-sidebar .brand {
    height: var(--gt-admin-header-height);
    min-height: var(--gt-admin-header-height);
    padding: 0 0.75rem;
    background: #fff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    box-sizing: border-box;
}

[data-theme="dark"] .admin-sidebar .brand {
    background: #fff;
    border-bottom-color: rgba(15, 23, 42, 0.12);
}

.admin-sidebar .brand-logo {
    display: block;
    object-fit: contain;
    transition: opacity var(--gt-transition), transform var(--gt-transition);
}

.admin-sidebar .brand-logo--full {
    width: 100%;
    max-width: 228px;
    max-height: calc(var(--gt-admin-header-height) - 1rem);
    height: auto;
    object-fit: contain;
    object-position: center;
}

.admin-sidebar .brand-logo--short {
    display: none;
    width: 42px;
    height: 42px;
}

.admin-sidebar.is-collapsed {
    width: 72px;
}

.admin-sidebar.is-collapsed .brand {
    padding: 0 0.65rem;
    height: var(--gt-admin-header-height);
    min-height: var(--gt-admin-header-height);
}

.admin-sidebar.is-collapsed .brand-logo--full {
    display: none;
}

.admin-sidebar.is-collapsed .brand-logo--short {
    display: block;
}

.admin-sidebar.is-collapsed .admin-nav a span {
    display: none;
}

.admin-sidebar.is-collapsed .admin-nav a {
    justify-content: center;
    padding: 0.7rem;
}

.gt-sidebar-toggle {
    border-radius: 0.5rem;
    line-height: 1;
    padding: 0.35rem 0.55rem;
}

.gt-sidebar-toggle-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
}

.gt-sidebar-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.gt-sidebar-icon--menu {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.gt-sidebar-icon--close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.gt-sidebar-toggle.is-collapsed .gt-sidebar-icon--menu {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.gt-sidebar-toggle.is-collapsed .gt-sidebar-icon--close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.gt-sidebar-toggle:active .gt-sidebar-icon {
    transform: scale(0.88);
}

.gt-sidebar-toggle.is-collapsed:active .gt-sidebar-icon--close {
    transform: rotate(0deg) scale(0.88);
}

.admin-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--gt-sidebar-text);
    text-decoration: none;
    transition: all var(--gt-transition);
    border-left: 3px solid transparent;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: #fff;
    background: rgba(5, 150, 105, 0.15);
    border-left-color: var(--gt-sidebar-active);
}

.admin-nav a.active { font-weight: 600; }

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.admin-topbar {
    height: var(--gt-admin-header-height);
    min-height: var(--gt-admin-header-height);
    background: var(--gt-surface);
    border-bottom: 1px solid var(--gt-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--gt-shadow);
    position: sticky;
    top: 0;
    z-index: 1020;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gt-user-menu {
    position: relative;
}

.gt-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.55rem 0.35rem 0.35rem;
    border: 1px solid var(--gt-border);
    border-radius: 999px;
    background: var(--gt-surface);
    color: var(--gt-text);
    cursor: pointer;
    transition: border-color var(--gt-transition), box-shadow var(--gt-transition), background var(--gt-transition);
}

.gt-user-trigger:hover,
.gt-user-trigger.show {
    border-color: rgba(5, 150, 105, 0.35);
    background: rgba(5, 150, 105, 0.04);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.08);
}

.gt-user-trigger.dropdown-toggle::after {
    display: none;
}

.gt-user-avatar {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gt-primary) 0%, #047857 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.gt-user-avatar--lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
}

.gt-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gt-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
}

.gt-user-role {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gt-text-muted);
    line-height: 1.2;
    text-transform: capitalize;
}

.gt-user-chevron {
    font-size: 0.7rem;
    color: var(--gt-text-muted);
    margin-left: -0.15rem;
}

.gt-user-dropdown {
    min-width: 15rem;
    padding: 0.35rem 0;
    border-radius: 0.85rem;
    margin-top: 0.5rem !important;
}

.gt-user-dropdown-head {
    pointer-events: none;
}

.gt-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.875rem;
    padding: 0.55rem 1rem;
}

.gt-user-dropdown-item .bi {
    font-size: 1rem;
    opacity: 0.85;
}

.gt-user-dropdown-item.text-danger .bi {
    opacity: 1;
}

[data-theme="dark"] .gt-user-trigger {
    background: var(--gt-surface);
}

[data-theme="dark"] .gt-user-dropdown {
    background: var(--gt-surface);
    border: 1px solid var(--gt-border) !important;
}

.admin-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-content:has(.gt-form-page),
.admin-content:has(.categories-page),
.admin-content:has(.orders-page),
.admin-content:has(.products-page),
.admin-content:has(.customers-page),
.admin-content:has(.coupons-page),
.admin-content:has(.banners-page),
.admin-content:has(.gt-dashboard-page) {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.admin-content:has(.categories-page),
.admin-content:has(.orders-page),
.admin-content:has(.products-page),
.admin-content:has(.customers-page),
.admin-content:has(.coupons-page),
.admin-content:has(.banners-page),
.admin-content:has(.gt-dashboard-page) {
    padding: 1.5rem;
}

.stat-card {
    background: var(--gt-surface);
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--gt-shadow);
    transition: transform var(--gt-transition);
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gt-primary);
}

.stat-card .stat-label {
    color: var(--gt-text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gt-sidebar-bg) 0%, #064e3b 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--gt-surface);
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow-lg);
    padding: 2rem;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 100%;
    max-width: 280px;
    height: auto;
    object-fit: contain;
    display: inline-block;
}

.login-actions {
    margin-top: 20px;
    margin-bottom:20px;
}

.login-form-error {
    display: block;
    min-height: 2.75rem;
    line-height: 1.35;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.login-form-error:empty {
    visibility: hidden;
}

/* Orders DataTable */
.orders-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.orders-pill {
    border: 1px solid var(--gt-border);
    background: var(--gt-surface);
    color: var(--gt-text-muted);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--gt-transition);
}

.orders-pill:hover,
.orders-pill.active {
    border-color: var(--gt-primary);
    background: rgba(5, 150, 105, 0.1);
    color: var(--gt-primary);
    font-weight: 600;
}

#orders-table thead th {
    color: var(--gt-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gt-border);
    white-space: nowrap;
}

#orders-table tbody td {
    vertical-align: middle;
    padding: 0.85rem 0.75rem;
    border-color: var(--gt-border);
}

#orders-table tbody tr:hover { background: rgba(5, 150, 105, 0.04); }

[data-theme="dark"] .orders-table-card .orders-table-scroll #orders-table thead th {
    background: var(--gt-surface);
    box-shadow: 0 2px 0 var(--gt-border), 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #orders-table thead th {
    background: transparent;
}

[data-theme="dark"] .orders-pill {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] #orders-table tbody tr:hover {
    background: rgba(5, 150, 105, 0.08);
}

/* Categories & Orders list pages */
.categories-page,
.orders-page,
.products-page,
.customers-page,
.coupons-page,
.banners-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.categories-toolbar,
.orders-toolbar,
.products-toolbar,
.customers-toolbar,
.coupons-toolbar,
.banners-toolbar {
    position: sticky;
    top: 0;
    z-index: 102;
    flex-shrink: 0;
    margin-bottom: 0 !important;
    border: 1px solid var(--gt-border);
    box-shadow: var(--gt-shadow);
    background: var(--gt-surface);
}

.categories-table-card,
.orders-table-card,
.products-table-card,
.customers-table-card,
.coupons-table-card,
.banners-table-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    border: 1px solid var(--gt-border);
    box-shadow: var(--gt-shadow);
    overflow: hidden;
}

.categories-table-card > .card-body,
.orders-table-card > .card-body,
.products-table-card > .card-body,
.customers-table-card > .card-body,
.coupons-table-card > .card-body,
.banners-table-card > .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.categories-table-card .dataTables_wrapper,
.orders-table-card .dataTables_wrapper,
.products-table-card .dataTables_wrapper,
.customers-table-card .dataTables_wrapper,
.coupons-table-card .dataTables_wrapper,
.banners-table-card .dataTables_wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.categories-table-card .dt-top,
.categories-table-card .dt-bottom,
.orders-table-card .dt-top,
.orders-table-card .dt-bottom,
.products-table-card .dt-top,
.products-table-card .dt-bottom,
.customers-table-card .dt-top,
.customers-table-card .dt-bottom,
.coupons-table-card .dt-top,
.coupons-table-card .dt-bottom,
.banners-table-card .dt-top,
.banners-table-card .dt-bottom {
    flex-shrink: 0;
}

.categories-table-card .categories-table-scroll .dt-top,
.orders-table-card .orders-table-scroll .dt-top,
.products-table-card .products-table-scroll .dt-top,
.customers-table-card .customers-table-scroll .dt-top,
.coupons-table-card .coupons-table-scroll .dt-top,
.banners-table-card .banners-table-scroll .dt-top {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gt-border);
    background: var(--gt-surface);
}

.categories-table-card .dt-bottom,
.orders-table-card .dt-bottom,
.products-table-card .dt-bottom,
.customers-table-card .dt-bottom,
.coupons-table-card .dt-bottom,
.banners-table-card .dt-bottom {
    border-top: 1px solid var(--gt-border);
    background: var(--gt-surface);
    margin: 0;
}

.categories-table-card .categories-table-scroll,
.orders-table-card .orders-table-scroll,
.products-table-card .products-table-scroll,
.customers-table-card .customers-table-scroll,
.coupons-table-card .coupons-table-scroll,
.banners-table-card .banners-table-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.categories-table-card .categories-table-scroll #categories-table,
.orders-table-card .orders-table-scroll #orders-table,
.products-table-card .products-table-scroll #products-table,
.customers-table-card .customers-table-scroll #customers-table,
.coupons-table-card .coupons-table-scroll #coupons-table,
.banners-table-card .banners-table-scroll #banners-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.categories-table-card .categories-table-scroll #categories-table thead th,
.orders-table-card .orders-table-scroll #orders-table thead th,
.products-table-card .products-table-scroll #products-table thead th,
.customers-table-card .customers-table-scroll #customers-table thead th,
.coupons-table-card .coupons-table-scroll #coupons-table thead th,
.banners-table-card .banners-table-scroll #banners-table thead th {
    position: sticky;
    z-index: 4;
    background: var(--gt-surface-alt, #f8fafc);
    color: var(--gt-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gt-border);
    white-space: nowrap;
    vertical-align: middle;
    box-shadow: 0 2px 0 var(--gt-border);
    background-clip: padding-box;
}

.categories-table-card .categories-table-scroll #categories-table thead th {
    top: var(--gt-categories-table-head-top, 2.75rem);
}

.orders-table-card .orders-table-scroll #orders-table thead th {
    top: var(--gt-orders-table-head-top, 2.75rem);
}

.products-table-card .products-table-scroll #products-table thead th {
    top: var(--gt-products-table-head-top, 2.75rem);
}

.customers-table-card .customers-table-scroll #customers-table thead th {
    top: var(--gt-customers-table-head-top, 2.75rem);
}

.coupons-table-card .coupons-table-scroll #coupons-table thead th {
    top: var(--gt-coupons-table-head-top, 2.75rem);
}

.banners-table-card .banners-table-scroll #banners-table thead th {
    top: var(--gt-banners-table-head-top, 2.75rem);
}

.categories-table-card .categories-table-scroll #categories-table thead th::after,
.orders-table-card .orders-table-scroll #orders-table thead th::after,
.products-table-card .products-table-scroll #products-table thead th::after,
.customers-table-card .customers-table-scroll #customers-table thead th::after,
.coupons-table-card .coupons-table-scroll #coupons-table thead th::after,
.banners-table-card .banners-table-scroll #banners-table thead th::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--gt-border);
    pointer-events: none;
}

.categories-table-card .dataTables_wrapper .dataTables_length,
.categories-table-card .dataTables_wrapper .dataTables_info,
.categories-table-card .dataTables_wrapper .dataTables_paginate,
.orders-table-card .dataTables_wrapper .dataTables_length,
.orders-table-card .dataTables_wrapper .dataTables_info,
.orders-table-card .dataTables_wrapper .dataTables_paginate,
.products-table-card .dataTables_wrapper .dataTables_length,
.products-table-card .dataTables_wrapper .dataTables_info,
.products-table-card .dataTables_wrapper .dataTables_paginate,
.customers-table-card .dataTables_wrapper .dataTables_length,
.customers-table-card .dataTables_wrapper .dataTables_info,
.customers-table-card .dataTables_wrapper .dataTables_paginate,
.coupons-table-card .dataTables_wrapper .dataTables_length,
.coupons-table-card .dataTables_wrapper .dataTables_info,
.coupons-table-card .dataTables_wrapper .dataTables_paginate,
.banners-table-card .dataTables_wrapper .dataTables_length,
.banners-table-card .dataTables_wrapper .dataTables_info,
.banners-table-card .dataTables_wrapper .dataTables_paginate {
    padding: 0.75rem 1rem;
}

.categories-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.orders-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.products-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.customers-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.coupons-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.banners-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--gt-primary) !important;
    border-color: var(--gt-primary) !important;
    color: #fff !important;
}

.categories-table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.orders-table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.products-table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.customers-table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.coupons-table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.banners-table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(5, 150, 105, 0.12) !important;
    border-color: var(--gt-primary) !important;
    color: var(--gt-primary) !important;
}

.dt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: var(--gt-text-muted);
}

.categories-status-pills,
.products-status-pills,
.customers-status-pills,
.customers-role-pills,
.coupons-status-pills,
.banners-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.categories-pill,
.products-pill,
.customers-pill,
.coupons-pill,
.banners-pill {
    border: 1px solid var(--gt-border);
    background: var(--gt-surface);
    color: var(--gt-text-muted);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--gt-transition);
}

.categories-pill:hover,
.categories-pill.active,
.products-pill:hover,
.products-pill.active,
.customers-pill:hover,
.customers-pill.active,
.coupons-pill:hover,
.coupons-pill.active,
.banners-pill:hover,
.banners-pill.active {
    border-color: var(--gt-primary);
    background: rgba(5, 150, 105, 0.1);
    color: var(--gt-primary);
    font-weight: 600;
}

#categories-table thead th {
    color: var(--gt-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gt-border);
    white-space: nowrap;
}

#categories-table tbody td {
    vertical-align: middle;
    padding: 0.85rem 0.75rem;
    border-color: var(--gt-border);
}

#categories-table tbody tr:hover { background: rgba(5, 150, 105, 0.04); }

#products-table thead th {
    color: var(--gt-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gt-border);
    white-space: nowrap;
}

#products-table tbody td {
    vertical-align: middle;
    padding: 0.85rem 0.75rem;
    border-color: var(--gt-border);
}

#products-table tbody tr:hover { background: rgba(5, 150, 105, 0.04); }

#customers-table thead th {
    color: var(--gt-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gt-border);
    white-space: nowrap;
}

#customers-table tbody td {
    vertical-align: middle;
    padding: 0.85rem 0.75rem;
    border-color: var(--gt-border);
}

#customers-table tbody tr:hover { background: rgba(5, 150, 105, 0.04); }

#coupons-table thead th,
#banners-table thead th {
    color: var(--gt-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gt-border);
    white-space: nowrap;
}

#coupons-table tbody td,
#banners-table tbody td {
    vertical-align: middle;
    padding: 0.85rem 0.75rem;
    border-color: var(--gt-border);
}

#coupons-table tbody tr:hover,
#banners-table tbody tr:hover { background: rgba(5, 150, 105, 0.04); }

.banner-thumb {
    object-fit: cover;
    background: var(--gt-surface-alt, #f1f5f9);
}

.banner-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 40px;
    border-radius: 0.375rem;
    background: var(--gt-surface-alt, #f1f5f9);
    color: var(--gt-text-muted);
    vertical-align: middle;
}

.customer-role-select {
    min-width: 7rem;
    max-width: 9rem;
}

.gt-stock-edit .form-control-sm {
    text-align: center;
    padding: 0.25rem 0.35rem;
}

.category-thumb { object-fit: contain; background: var(--gt-surface-alt, #f1f5f9); padding: 2px; }

.category-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    background: var(--gt-surface-alt, #f1f5f9);
    color: var(--gt-text-muted);
    vertical-align: middle;
}

[data-theme="dark"] .categories-table-card .categories-table-scroll #categories-table thead th {
    background: var(--gt-surface);
    box-shadow: 0 2px 0 var(--gt-border), 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #categories-table thead th {
    background: transparent;
}

[data-theme="dark"] .categories-pill,
[data-theme="dark"] .products-pill,
[data-theme="dark"] .customers-pill,
[data-theme="dark"] .coupons-pill,
[data-theme="dark"] .banners-pill {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] #categories-table tbody tr:hover {
    background: rgba(5, 150, 105, 0.08);
}

[data-theme="dark"] #products-table tbody tr:hover {
    background: rgba(5, 150, 105, 0.08);
}

[data-theme="dark"] #customers-table tbody tr:hover {
    background: rgba(5, 150, 105, 0.08);
}

[data-theme="dark"] #coupons-table tbody tr:hover,
[data-theme="dark"] #banners-table tbody tr:hover {
    background: rgba(5, 150, 105, 0.08);
}

[data-theme="dark"] .products-table-card .products-table-scroll #products-table thead th {
    background: var(--gt-surface);
    box-shadow: 0 2px 0 var(--gt-border), 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .customers-table-card .customers-table-scroll #customers-table thead th {
    background: var(--gt-surface);
    box-shadow: 0 2px 0 var(--gt-border), 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .coupons-table-card .coupons-table-scroll #coupons-table thead th,
[data-theme="dark"] .banners-table-card .banners-table-scroll #banners-table thead th {
    background: var(--gt-surface);
    box-shadow: 0 2px 0 var(--gt-border), 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .category-thumb-placeholder {
    background: rgba(255, 255, 255, 0.06);
}

/* Admin Forms */
.gt-form-page {
    width: 100%;
    max-width: none;
    margin: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, var(--gt-bg, #f1f5f9) 0%, var(--gt-surface) 220px);
}

.gt-form-header {
    position: relative;
    top: auto;
    z-index: 1010;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: var(--gt-surface);
    border-bottom: 1px solid var(--gt-border);
    padding: 1rem 1.75rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.gt-form-header-main { flex: 1; min-width: 0; }

.gt-form-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    margin-bottom: 0.65rem;
    color: var(--gt-text-muted);
}

.gt-form-breadcrumb-link {
    color: var(--gt-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--gt-transition);
}

.gt-form-breadcrumb-link:hover { color: var(--gt-primary); }

.gt-form-breadcrumb-current {
    color: var(--gt-text);
    font-weight: 600;
}

.gt-form-breadcrumb .bi-chevron-right {
    font-size: 0.65rem;
    opacity: 0.5;
}

.gt-form-header-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.gt-form-header-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, var(--gt-primary) 0%, #047857 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    flex-shrink: 0;
}

.gt-form-header-action {
    flex-shrink: 0;
    border-radius: 999px;
    font-weight: 500;
}

.gt-form-body {
    flex: 1;
    min-height: 0;
    padding: 1.5rem 1.75rem;
    width: 100%;
    max-width: none;
    overflow: hidden;
}

.gt-form-body .gt-admin-form {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gt-form-body > .gt-admin-form > .row {
    flex: 1;
    min-height: 0;
    align-items: stretch;
    margin-bottom: 0;
}

@media (min-width: 992px) {
    .gt-form-body .gt-admin-form > .row > .col-lg-8 {
        min-height: 0;
        max-height: calc(100vh - var(--gt-admin-header-height) - 10rem);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 0.5rem;
        scrollbar-gutter: stable;
        -webkit-overflow-scrolling: touch;
    }

    .gt-form-body .gt-admin-form > .row > .col-lg-8:has(> .gt-form-scroll) {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .gt-form-scroll {
        max-height: calc(100vh - var(--gt-admin-header-height) - 10rem);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 0.5rem;
        scrollbar-gutter: stable;
        -webkit-overflow-scrolling: touch;
    }

    .gt-form-body .gt-admin-form > .row > .col-lg-4 {
        overflow: visible;
    }

    .gt-form-actions.sticky-top {
        position: static;
        top: auto;
    }
}

.gt-form-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--gt-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.gt-form-back:hover { color: var(--gt-primary-hover); }

.gt-form-subtitle {
    font-size: 0.9rem;
    color: var(--gt-text-muted);
    line-height: 1.5;
    max-width: 42rem;
}

/* Step progress */
.gt-form-progress {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background: var(--gt-surface);
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow);
    overflow-x: auto;
}

.gt-form-progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.gt-form-progress-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gt-primary-light, #d1fae5);
    color: var(--gt-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.gt-form-progress-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gt-text);
    white-space: nowrap;
}

.gt-form-progress-line {
    flex: 1;
    min-width: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--gt-primary-light, #d1fae5), var(--gt-border));
    margin: 0 0.75rem;
    border-radius: 1px;
}

/* Form sections */
.gt-form-card {
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    background: var(--gt-surface);
    transition: box-shadow var(--gt-transition), border-color var(--gt-transition);
}

.gt-form-card:hover {
    border-color: rgba(5, 150, 105, 0.22);
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(5, 150, 105, 0.08);
}

.gt-form-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--gt-border);
    padding: 1rem 1.35rem;
    border-left: 4px solid var(--gt-primary);
}

.gt-form-card-header strong {
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.gt-form-card-header small {
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.gt-form-card .card-body {
    padding: 1.35rem 1.5rem;
}

.gt-step-badge {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--gt-primary) 0%, #047857 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

.gt-step-badge i { font-size: 1rem; }

.gt-admin-form .form-control,
.gt-admin-form .form-select {
    border-color: var(--gt-border);
    border-radius: 0.6rem;
    transition: border-color var(--gt-transition), box-shadow var(--gt-transition);
}

.gt-admin-form .form-control:focus,
.gt-admin-form .form-select:focus {
    border-color: var(--gt-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.gt-admin-form .form-control-lg {
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
}

.gt-form-label {
    font-weight: 600;
    font-size: 0.84rem;
    margin-bottom: 0.4rem;
    color: var(--gt-text);
    letter-spacing: 0.01em;
}

.gt-form-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    top: 1rem;
    background: var(--gt-surface);
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    padding: 1.15rem 1.25rem;
    z-index: 1005;
    box-shadow: var(--gt-shadow);
}

.gt-form-actions-hint {
    margin: 0;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--gt-border);
    line-height: 1.45;
    text-align: center;
}

.gt-form-actions .btn {
    width: 100%;
    justify-content: center;
}

.gt-form-actions .btn-primary {
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    border-radius: 0.6rem;
    font-weight: 600;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.gt-form-actions .btn-outline-secondary {
    border-radius: 0.6rem;
    font-weight: 500;
}

.gt-field-hint {
    font-size: 0.8rem;
    color: var(--gt-text-muted);
    margin-top: 0.35rem;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    line-height: 1.4;
}

.gt-field-hint .bi {
    color: var(--gt-primary);
    opacity: 0.75;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.gt-field-error {
    display: block;
    min-height: 1.25rem;
    font-size: 0.82rem;
    line-height: 1.25rem;
    margin-top: 0.25rem;
}

.gt-field-error:empty {
    visibility: hidden;
}

.gt-form-summary:not(:empty) { display: block; }
.gt-form-summary:empty { display: none !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }

.gt-toggle-card {
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    padding: 1.15rem 1.25rem;
    background: var(--gt-surface);
    transition: border-color var(--gt-transition), background var(--gt-transition), box-shadow var(--gt-transition);
}

.gt-toggle-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.gt-toggle-card-main {
    flex: 1;
    min-width: 0;
}

.gt-toggle-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gt-text);
    line-height: 1.3;
}

.gt-toggle-card-switch {
    flex-shrink: 0;
}

.gt-toggle-card-switch .form-check-input {
    margin-left: 0;
    float: none;
}

.gt-toggle-card.is-on {
    border-color: rgba(5, 150, 105, 0.4);
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(5, 150, 105, 0.02) 100%);
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.08);
}

.gt-form-switch .form-check-input {
    width: 2.75rem;
    height: 1.35rem;
    cursor: pointer;
}

/* Image Upload */
.gt-image-upload {
    padding: 1rem;
    border: 1px dashed var(--gt-border);
    border-radius: var(--gt-radius-lg);
    background: linear-gradient(180deg, rgba(5, 150, 105, 0.03) 0%, transparent 100%);
}

.gt-image-upload-box {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.gt-image-upload-media {
    flex-shrink: 0;
    width: 180px;
}

.gt-image-upload-preview-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    border: 2px dashed var(--gt-border);
    border-radius: var(--gt-radius);
    background: var(--gt-surface-alt, #f8fafc);
    overflow: hidden;
}

.gt-image-upload-preview {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    cursor: zoom-in;
    background: #fff;
    padding: 0.5rem;
}

.gt-image-upload-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gt-text-muted);
    text-align: center;
    padding: 1rem;
    background: var(--gt-surface-alt, #f8fafc);
}

.gt-image-upload-placeholder i {
    font-size: 2rem;
    opacity: 0.45;
}

.gt-image-upload-placeholder span {
    font-size: 0.8rem;
    line-height: 1.35;
    max-width: 120px;
}

.gt-image-upload-zoom-hint {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gt-text-muted);
    margin: 0.45rem 0 0;
    line-height: 1.35;
}

.gt-image-upload-controls {
    flex: 1;
    min-width: min(100%, 280px);
}

.gt-image-upload-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gt-image-upload-actions .text-muted {
    margin-right: auto;
    font-size: 0.78rem;
}

.gt-file-picker {
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

/* Image Popup (global .gt-image-zoom) */
.gt-image-zoom { cursor: zoom-in; }

.gt-image-popup {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.gt-image-popup.is-open { display: flex; }

.gt-image-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(4px);
}

.gt-image-popup-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(94vw, 1050px);
    max-height: 96vh;
    --gt-popup-chrome: 7.5rem;
    background: var(--gt-surface);
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow-lg);
    border: 1px solid var(--gt-border);
    overflow: hidden;
    animation: gt-popup-in 0.2s ease;
}

.gt-image-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--gt-border);
    background: var(--gt-surface-alt, #f8fafc);
    flex-shrink: 0;
}

.gt-image-popup-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gt-text);
    min-width: 0;
}

.gt-image-popup-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(5, 150, 105, 0.1);
    color: var(--gt-primary);
    flex-shrink: 0;
}

.gt-image-popup-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gt-border);
    background: var(--gt-surface);
    border-radius: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.95rem;
    line-height: 1;
    color: var(--gt-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.gt-image-popup-close:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #dc2626;
}

.gt-image-popup-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    padding: 1rem 1.15rem;
    background: var(--gt-surface);
}

.gt-image-popup-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

.gt-image-popup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.15rem;
    border-top: 1px solid var(--gt-border);
    background: var(--gt-surface-alt, #f8fafc);
    flex-shrink: 0;
}

.gt-image-popup-footer .btn {
    min-width: 6.5rem;
    font-weight: 600;
}

.gt-image-popup-img {
    display: block;
    max-width: min(100%, calc(94vw - 2.5rem));
    max-height: calc(96vh - var(--gt-popup-chrome));
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: var(--gt-radius);
}

.gt-image-popup-empty {
    text-align: center;
    color: var(--gt-text-muted);
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gt-image-popup-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.55;
}

body.gt-image-popup-open { overflow: hidden; }

@keyframes gt-popup-in {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 991.98px) {
    .admin-content:has(.gt-form-page),
    .admin-content:has(.categories-page),
    .admin-content:has(.orders-page),
    .admin-content:has(.products-page),
    .admin-content:has(.customers-page),
    .admin-content:has(.coupons-page),
    .admin-content:has(.banners-page),
    .admin-content:has(.gt-dashboard-page) {
        overflow-y: auto;
    }

    .categories-page,
    .orders-page,
    .products-page,
    .customers-page,
    .coupons-page,
    .banners-page,
    .gt-dashboard-page {
        min-height: 100%;
        overflow: visible;
    }

    .gt-dashboard-scroll {
        flex: none;
        overflow: visible;
        max-height: none;
    }

    .categories-table-card,
    .orders-table-card,
    .products-table-card,
    .customers-table-card,
    .coupons-table-card,
    .banners-table-card {
        flex: none;
        min-height: auto;
    }

    .categories-table-card .categories-table-scroll,
    .orders-table-card .orders-table-scroll,
    .products-table-card .products-table-scroll,
    .customers-table-card .customers-table-scroll,
    .coupons-table-card .coupons-table-scroll,
    .banners-table-card .banners-table-scroll {
        flex: none;
        max-height: min(62vh, 520px);
    }

    .gt-form-page {
        min-height: 100%;
        overflow: visible;
    }

    .gt-form-header {
        position: sticky;
        top: 0;
    }

    .gt-form-body {
        overflow: visible;
    }

    .gt-form-body .gt-admin-form {
        height: auto;
        display: block;
    }

    .gt-form-body .gt-admin-form > .row {
        flex: none;
        min-height: auto;
    }

    .gt-form-body .gt-admin-form > .row > .col-lg-8,
    .gt-form-scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .gt-order-detail-page .gt-form-body > .row {
        flex: none;
        min-height: auto;
    }

    .gt-form-actions {
        position: sticky;
        bottom: 0;
        top: auto !important;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        border-radius: 0;
        border: 0;
        border-top: 1px solid var(--gt-border);
        margin-left: -1rem;
        margin-right: -1rem;
        margin-bottom: -1rem;
        padding: 0.85rem 1rem;
        box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.06);
    }
    .gt-form-actions-hint {
        display: none !important;
        border: 0;
        padding: 0;
    }
    .gt-form-actions .btn { width: auto; }
    .gt-form-actions .btn-primary { flex: 1 1 auto; min-width: 8rem; }
}

@media (max-width: 576px) {
    .gt-form-header { padding: 0.85rem 1rem; flex-direction: column; }
    .gt-form-header-action { align-self: flex-start; }
    .gt-form-body { padding: 1rem; }
    .gt-form-progress { padding: 0.85rem; }
    .gt-form-progress-label { font-size: 0.75rem; }
    .gt-image-upload-media,
    .gt-image-upload-preview-wrap {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    .gt-image-upload-preview-wrap { height: 200px; }
    .gt-image-upload-box { justify-content: center; }
    .gt-image-upload-actions { justify-content: center; }
    .gt-image-upload-actions .text-muted { margin-right: 0; width: 100%; text-align: center; }
    .gt-image-popup-body {
        padding: 0.75rem;
    }
}

[data-theme="dark"] .gt-form-card-header,
[data-theme="dark"] .gt-image-upload-placeholder {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .gt-form-header,
[data-theme="dark"] .gt-form-actions {
    background: var(--gt-surface);
}

[data-theme="dark"] .admin-content > .gt-form-page,
[data-theme="dark"] .gt-form-page {
    background: linear-gradient(180deg, #0f172a 0%, var(--gt-surface) 220px);
}

[data-theme="dark"] .gt-form-card:hover {
    border-color: rgba(5, 150, 105, 0.35);
}

[data-theme="dark"] .gt-form-card-header {
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.12) 0%, transparent 100%);
}

/* Settings page */
.gt-settings-status-card {
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow);
    overflow: hidden;
}

.gt-settings-status-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.gt-settings-status-icon.is-open {
    background: rgba(5, 150, 105, 0.12);
    color: var(--gt-primary);
    box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.06);
}

.gt-settings-status-icon.is-closed {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.05);
}

.gt-settings-summary li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--gt-border);
}

.gt-settings-summary li:last-child {
    border-bottom: 0;
}

.gt-settings-summary li span {
    color: var(--gt-text-muted);
}

/* Location picker (reusable) */
.gt-location-picker {
    padding: 1rem;
    border: 1px dashed rgba(5, 150, 105, 0.25);
    border-radius: var(--gt-radius-lg);
    background: linear-gradient(180deg, rgba(5, 150, 105, 0.03) 0%, transparent 100%);
}

.gt-location-status {
    min-height: 1.5rem;
    font-size: 0.84rem;
    line-height: 1.45;
}

.gt-location-status.is-loading {
    color: var(--gt-text-muted);
}

.gt-location-status.is-error {
    color: #dc2626;
}

.gt-location-status.is-success {
    color: var(--gt-text);
}

/* Order details */
.gt-order-detail-page .gt-form-body {
    display: flex;
    flex-direction: column;
}

.gt-order-detail-page .gt-form-body > .row {
    flex: 1;
    min-height: 0;
    align-items: stretch;
    margin-bottom: 0;
}

.gt-order-detail-page .gt-form-card-header .badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.gt-order-status-track {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.25rem 0;
}

.gt-order-status-step {
    flex: 1;
    min-width: 4.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    position: relative;
}

.gt-order-status-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1.1rem;
    left: calc(50% + 1.1rem);
    width: calc(100% - 2.2rem);
    height: 2px;
    background: var(--gt-border);
    z-index: 0;
}

.gt-order-status-step.is-done:not(:last-child)::after,
.gt-order-status-step.is-current:not(:last-child)::after {
    background: var(--gt-primary);
}

.gt-order-status-dot {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gt-surface-alt, #f1f5f9);
    color: var(--gt-text-muted);
    border: 2px solid var(--gt-border);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
    transition: all var(--gt-transition);
}

.gt-order-status-step.is-done .gt-order-status-dot,
.gt-order-status-step.is-current .gt-order-status-dot {
    background: rgba(5, 150, 105, 0.12);
    border-color: var(--gt-primary);
    color: var(--gt-primary);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.08);
}

.gt-order-status-step.is-current .gt-order-status-dot {
    background: var(--gt-primary);
    color: #fff;
}

.gt-order-status-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gt-text-muted);
    line-height: 1.25;
}

.gt-order-status-step.is-done .gt-order-status-label,
.gt-order-status-step.is-current .gt-order-status-label {
    color: var(--gt-text);
    font-weight: 600;
}

.gt-order-cancelled-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: var(--gt-radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
    color: #b91c1c;
}

.gt-order-cancelled-banner i {
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.gt-order-items-table thead th {
    background: var(--gt-surface-alt, #f8fafc);
    color: var(--gt-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gt-border);
    white-space: nowrap;
    padding: 0.75rem;
}

.gt-order-items-table tbody td,
.gt-order-items-table tfoot td {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
    border-color: var(--gt-border);
}

.gt-order-items-table tbody tr:hover {
    background: rgba(5, 150, 105, 0.04);
}

.gt-order-items-table tfoot td {
    border-top: 2px solid var(--gt-border);
    background: var(--gt-surface-alt, #f8fafc);
}

.gt-order-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    height: 100%;
}

.gt-order-info-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 150, 105, 0.1);
    color: var(--gt-primary);
    flex-shrink: 0;
}

.gt-order-info-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gt-text-muted);
    margin-bottom: 0.2rem;
}

.gt-order-info-link {
    color: var(--gt-primary);
    font-weight: 600;
    text-decoration: none;
}

.gt-order-info-link:hover {
    color: var(--gt-primary-hover);
    text-decoration: underline;
}

.gt-order-location-text {
    font-weight: 500;
    line-height: 1.55;
    color: var(--gt-text);
}

.gt-order-location-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.gt-order-location-chips .badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35rem 0.55rem;
}

.gt-order-coords {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
}

.gt-order-delivery-card .gt-order-delivery-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gt-text-muted);
}

.gt-order-delivery-qty {
    max-width: 5rem;
    margin-inline: auto;
    font-weight: 600;
}

.gt-order-return-note {
    border-color: rgba(217, 119, 6, 0.35);
    background: rgba(217, 119, 6, 0.05);
}

.gt-order-return-note > i {
    color: #d97706;
}

.gt-order-summary-original {
    font-size: 0.85rem;
}

.badge-status-partiallydelivered {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.gt-order-note {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--gt-radius);
    border: 1px dashed rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.04);
}

.gt-order-note > i {
    color: var(--gt-primary);
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.gt-order-summary li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--gt-border);
    font-size: 0.9rem;
}

.gt-order-summary li:last-child {
    border-bottom: 0;
}

.gt-order-summary li span {
    color: var(--gt-text-muted);
}

.gt-order-summary-total {
    margin-top: 0.35rem;
    padding-top: 0.75rem !important;
    border-top: 2px solid var(--gt-border) !important;
    font-size: 1rem !important;
}

.gt-order-summary-total strong {
    font-size: 1.15rem;
    color: var(--gt-primary);
}

.gt-order-detail-page .gt-form-body > .row > .col-lg-4 .card:last-of-type {
    position: sticky;
    top: 1rem;
    z-index: 100;
}

@media (max-width: 991.98px) {
    .gt-order-status-label {
        font-size: 0.68rem;
    }

    .gt-order-detail-page .gt-form-body > .row > .col-lg-4 .card:last-of-type {
        position: static;
    }
}

[data-theme="dark"] .gt-order-items-table thead th,
[data-theme="dark"] .gt-order-items-table tfoot td {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .gt-order-status-dot {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .gt-order-cancelled-banner {
    color: #fca5a5;
}

[data-theme="dark"] .gt-order-note {
    background: rgba(5, 150, 105, 0.08);
}

/* ========== Admin Dashboard ========== */
.gt-dashboard-page {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 0;
}

.gt-dashboard-sticky-head {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 101;
    background: var(--gt-bg);
    padding-bottom: 1rem;
    margin-bottom: 0;
}

.gt-dashboard-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.gt-dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gt-dashboard-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gt-primary);
}

.gt-dashboard-title {
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
    font-weight: 700;
    color: var(--gt-text);
    letter-spacing: -0.02em;
}

.gt-dashboard-subtitle {
    font-size: 0.9rem;
    color: var(--gt-text-muted);
}

.gt-dashboard-subtitle-dot {
    margin: 0 0.35rem;
    opacity: 0.5;
}

.gt-dashboard-toolbar {
    border: 1px solid var(--gt-border);
    box-shadow: var(--gt-shadow);
    border-radius: var(--gt-radius-lg);
    margin-bottom: 0 !important;
}

.gt-dashboard-empty {
    border: 1px dashed var(--gt-border);
    background: var(--gt-surface);
}

.gt-dashboard-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    color: var(--gt-warning);
    font-size: 1.75rem;
}

.gt-dash-stat {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-radius: var(--gt-radius-lg);
    border: 1px solid var(--gt-border);
    background: var(--gt-surface);
    box-shadow: var(--gt-shadow);
    height: 100%;
    transition: transform var(--gt-transition), box-shadow var(--gt-transition);
    position: relative;
    overflow: hidden;
}

.gt-dash-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.85;
}

.gt-dash-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--gt-shadow-lg);
}

.gt-dash-stat--orders::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.gt-dash-stat--revenue::before { background: linear-gradient(90deg, var(--gt-primary), #34d399); }
.gt-dash-stat--avg::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.gt-dash-stat--customers::before { background: linear-gradient(90deg, var(--gt-accent), #fbbf24); }

.gt-dash-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.gt-dash-stat--orders .gt-dash-stat-icon { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.gt-dash-stat--revenue .gt-dash-stat-icon { background: rgba(5, 150, 105, 0.12); color: var(--gt-primary); }
.gt-dash-stat--avg .gt-dash-stat-icon { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.gt-dash-stat--customers .gt-dash-stat-icon { background: rgba(245, 158, 11, 0.12); color: var(--gt-accent); }

.gt-dash-stat-value {
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gt-text);
    letter-spacing: -0.02em;
}

.gt-dash-stat-label {
    font-size: 0.82rem;
    color: var(--gt-text-muted);
    margin-top: 0.2rem;
}

.gt-dashboard-panel {
    border: 1px solid var(--gt-border);
    box-shadow: var(--gt-shadow);
    border-radius: var(--gt-radius-lg);
    overflow: hidden;
}

.gt-dashboard-panel-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: var(--gt-surface);
    border-bottom: 1px solid var(--gt-border);
    padding: 1rem 1.25rem;
}

.gt-dashboard-panel-header strong {
    font-size: 0.95rem;
}

.gt-dashboard-chart-wrap {
    position: relative;
    height: min(320px, 42vh);
    min-height: 220px;
}

.gt-dashboard-chart-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--gt-text-muted);
}

.gt-dashboard-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.gt-legend-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: inline-block;
}

.gt-legend-dot--revenue { background: var(--gt-primary); }
.gt-legend-dot--orders { background: var(--gt-info); }

.gt-dashboard-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.gt-dashboard-status-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.gt-dashboard-status-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gt-text);
}

.gt-dashboard-status-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.gt-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.gt-status-dot--pending { background: var(--gt-warning); }
.gt-status-dot--confirmed { background: var(--gt-info); }
.gt-status-dot--preparing { background: #8b5cf6; }
.gt-status-dot--out { background: #06b6d4; }
.gt-status-dot--delivered { background: var(--gt-success); }
.gt-status-dot--cancelled { background: var(--gt-danger); }

.gt-dashboard-status-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--gt-border);
    overflow: hidden;
}

.gt-dashboard-status-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gt-info), #60a5fa);
    transition: width 0.5s ease;
}

.gt-dashboard-status-bar--success span {
    background: linear-gradient(90deg, var(--gt-primary), #34d399);
}

.gt-dashboard-status-bar--danger span {
    background: linear-gradient(90deg, var(--gt-danger), #f87171);
}

.gt-dashboard-inventory-stat {
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1rem;
    border-radius: var(--gt-radius);
    background: var(--gt-bg);
    border: 1px solid var(--gt-border);
}

.gt-dashboard-inventory-stat.is-alert {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
}

.gt-dashboard-inventory-stat.is-alert .gt-dashboard-inventory-value {
    color: var(--gt-danger);
}

.gt-dashboard-inventory-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--gt-text);
}

.gt-dashboard-top-list {
    padding: 0.25rem 0;
}

.gt-dashboard-top-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--gt-border);
    transition: background var(--gt-transition);
}

.gt-dashboard-top-item:last-child {
    border-bottom: none;
}

.gt-dashboard-top-item:hover {
    background: rgba(5, 150, 105, 0.04);
}

.gt-dashboard-top-rank {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--gt-bg);
    color: var(--gt-text-muted);
    border: 1px solid var(--gt-border);
}

.gt-dashboard-top-rank.rank-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    border-color: transparent;
}

.gt-dashboard-top-rank.rank-silver {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #334155;
    border-color: transparent;
}

.gt-dashboard-top-rank.rank-bronze {
    background: linear-gradient(135deg, #fdba74, #ea580c);
    color: #7c2d12;
    border-color: transparent;
}

.gt-dashboard-top-main {
    flex: 1;
    min-width: 0;
}

.gt-dashboard-top-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.gt-dashboard-top-head strong {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-dashboard-top-revenue {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--gt-primary);
    white-space: nowrap;
}

.gt-dashboard-top-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--gt-text-muted);
}

.gt-dashboard-top-bar {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: var(--gt-border);
    overflow: hidden;
    min-width: 60px;
}

.gt-dashboard-top-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gt-primary), #34d399);
}

.gt-dashboard-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

[data-theme="dark"] .gt-dashboard-sticky-head {
    background: var(--gt-bg);
}

[data-theme="dark"] .gt-dash-stat,
[data-theme="dark"] .gt-dashboard-panel,
[data-theme="dark"] .gt-dashboard-toolbar {
    background: var(--gt-surface);
}

[data-theme="dark"] .gt-dashboard-inventory-stat {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .gt-dashboard-top-item:hover {
    background: rgba(5, 150, 105, 0.08);
}

@media (max-width: 575.98px) {
    .gt-dashboard-hero-actions {
        width: 100%;
    }

    .gt-dashboard-top-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
