/* ------------------------------------------------------------------ */
/* VAT Declaration Pro — admin theme (Polaris-inspired)                */
/* ------------------------------------------------------------------ */

:root {
    --vdp-bg: #f6f6f7;
    --vdp-surface: #ffffff;
    --vdp-border: #d2d5d9;
    --vdp-text: #202223;
    --vdp-text-subtle: #6d7175;
    --vdp-primary: #008060;
    --vdp-primary-hover: #006e52;
    --vdp-danger: #d82c0d;
    --vdp-sidebar: #202223;
    --vdp-sidebar-text: #b5b5b6;
    --vdp-radius: 8px;
    --vdp-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
}

body.admin-body {
    background: var(--vdp-bg);
    color: var(--vdp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

/* Sidebar ----------------------------------------------------------------- */
.admin-shell {
    min-height: 100vh;
}

.admin-sidebar {
    width: 232px;
    background: var(--vdp-sidebar);
    color: var(--vdp-sidebar-text);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--vdp-primary);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .5px;
}

.brand-text strong { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.brand-text small { color: var(--vdp-sidebar-text); font-size: 11px; }

.sidebar-nav {
    padding: 10px 8px;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 2px;
    border-radius: 6px;
    color: var(--vdp-sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    transition: background .15s ease, color .15s ease;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: var(--vdp-primary);
    color: #fff;
}

.sidebar-nav .nav-item svg { flex-shrink: 0; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 13px;
    color: #e3e3e3;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #616161;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Mobile bar -------------------------------------------------------------- */
.admin-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--vdp-sidebar);
    color: #fff;
    padding: 10px 14px;
    gap: 10px;
}

.admin-mobile-bar .brand-mark { width: 28px; height: 28px; font-size: 10px; }

/* Main -------------------------------------------------------------------- */
.admin-main {
    min-width: 0;
}

.admin-topbar {
    padding: 18px 28px;
    background: var(--vdp-surface);
    border-bottom: 1px solid var(--vdp-border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-title { font-size: 20px; font-weight: 600; margin: 0; }
.topbar-subtitle { font-size: 12.5px; color: var(--vdp-text-subtle); }

.shop-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--vdp-border);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--vdp-text);
    background: #fafbfb;
}

.admin-content {
    padding: 24px 28px 8px;
    max-width: 1280px;
    margin: 0 auto;
}

.admin-footer { color: var(--vdp-text-subtle); font-size: 12px; }

/* Cards ------------------------------------------------------------------- */
.admin-card {
    background: var(--vdp-surface);
    border: 1px solid var(--vdp-border);
    border-radius: var(--vdp-radius);
    box-shadow: var(--vdp-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.admin-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f2f3;
    flex-wrap: wrap;
}

.admin-card__title { font-size: 15px; font-weight: 600; margin: 0; }
.admin-card__subtitle { font-size: 12.5px; color: var(--vdp-text-subtle); margin: 2px 0 0; }

.admin-card__body { padding: 20px; }
.admin-card__body.p-0 { padding: 0; }

/* Stats ------------------------------------------------------------------- */
.stat-card__label { font-size: 12px; color: var(--vdp-text-subtle); font-weight: 500; }
.stat-card__value { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.stat-card__hint { font-size: 12px; color: var(--vdp-text-subtle); }

/* Tables ------------------------------------------------------------------ */
.admin-table { font-size: 13.5px; }
.admin-table thead th {
    background: #fafbfb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--vdp-text-subtle);
    border-bottom: 1px solid var(--vdp-border);
    padding: 10px 16px;
    white-space: nowrap;
}
.admin-table tbody td { padding: 12px 16px; border-bottom: 1px solid #f1f2f3; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fafbfb; }

/* Status list / quick settings --------------------------------------------- */
.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
    border-bottom: 1px dashed #ececec;
    padding-bottom: 8px;
}
.status-item:last-child { border-bottom: 0; padding-bottom: 0; }
.status-item__value { font-weight: 500; text-align: right; }

.quick-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-setting {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--vdp-border);
    border-radius: var(--vdp-radius);
    color: var(--vdp-text);
    text-decoration: none;
    font-size: 13.5px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.quick-setting:hover { border-color: var(--vdp-primary); box-shadow: 0 0 0 1px var(--vdp-primary); color: var(--vdp-text); }
.quick-setting svg { color: var(--vdp-primary); }

/* Activity feed ------------------------------------------------------------ */
.activity-feed { display: flex; flex-direction: column; }
.activity-feed__item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #ececec;
}
.activity-feed__item:last-child { border-bottom: 0; }
.activity-feed__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vdp-primary);
    margin-top: 6px;
    flex-shrink: 0;
}
.activity-feed__label { font-weight: 600; font-size: 13px; }
.activity-feed__detail { font-size: 12.5px; color: var(--vdp-text-subtle); }
.activity-feed__time { font-size: 11.5px; color: #8c9196; }

/* Tabs --------------------------------------------------------------------- */
.admin-tabs { gap: 6px; border-bottom: 1px solid #ececec; padding-bottom: 10px; flex-wrap: wrap; }
.admin-tabs .nav-link {
    font-size: 13px;
    color: var(--vdp-text-subtle);
    border-radius: 6px;
    padding: 6px 14px;
}
.admin-tabs .nav-link.active { background: #eef6f1; color: var(--vdp-primary); font-weight: 600; }

/* Buttons ------------------------------------------------------------------ */
.btn-primary {
    --bs-btn-bg: var(--vdp-primary);
    --bs-btn-border-color: var(--vdp-primary);
    --bs-btn-hover-bg: var(--vdp-primary-hover);
    --bs-btn-hover-border-color: var(--vdp-primary-hover);
    --bs-btn-active-bg: var(--vdp-primary-hover);
    --bs-btn-active-border-color: var(--vdp-primary-hover);
    --bs-btn-disabled-bg: var(--vdp-primary);
    --bs-btn-disabled-border-color: var(--vdp-primary);
}

/* Preview frame ------------------------------------------------------------- */
.preview-frame--desktop { width: 100%; }
.preview-frame--mobile { width: 390px; max-width: 100%; margin: 0 auto; }
.sticky-preview { position: sticky; top: 84px; }

.preview-frame {
    border: 1px dashed var(--vdp-border);
    border-radius: var(--vdp-radius);
    padding: 16px;
    background: #fff;
}

.vatdp-block { padding: 16px; }

/* Charts ------------------------------------------------------------------- */
.chart-wrap { position: relative; height: 280px; }
.chart-wrap--small { height: 240px; }

/* Description list ---------------------------------------------------------- */
.admin-dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 16px;
    margin: 0;
}
.admin-dl dt { color: var(--vdp-text-subtle); font-weight: 500; font-size: 13px; }
.admin-dl dd { margin: 0; font-size: 13.5px; }

.admin-pre {
    background: #f6f6f7;
    border: 1px solid var(--vdp-border);
    border-radius: 6px;
    padding: 12px;
    font-size: 11.5px;
    max-height: 480px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Toast --------------------------------------------------------------------- */
.admin-toast {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 420px;
    padding: 12px 14px;
    background: #202223;
    color: #fff;
    border-radius: var(--vdp-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    font-size: 13.5px;
}
.admin-toast--success .admin-toast__icon { color: #3dbb8a; }
.admin-toast--error .admin-toast__icon { color: #ff8c66; }
.admin-toast__close {
    background: none;
    border: 0;
    color: rgba(255, 255, 255, .7);
    margin-left: auto;
    padding: 0;
    line-height: 1;
}
.admin-toast__close:hover { color: #fff; }

/* Empty state ---------------------------------------------------------------- */
.admin-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f1f1f1;
    color: #8c9196;
}

/* Skeleton ------------------------------------------------------------------- */
.skeleton-loader { padding: 8px 0; }
.skeleton-row { display: flex; gap: 12px; margin-bottom: 12px; }
.skeleton-cell {
    flex: 1;
    height: 42px;
    border-radius: 6px;
    background: linear-gradient(90deg, #ececec 25%, #f6f6f7 50%, #ececec 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s infinite;
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Plan cards ----------------------------------------------------------------- */
.plan-card { transition: box-shadow .15s ease, transform .15s ease; }
.plan-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.plan-card--current { border-color: var(--vdp-primary); box-shadow: 0 0 0 1px var(--vdp-primary); }
.plan-card__name { font-size: 16px; font-weight: 700; }
.plan-card__price { font-size: 30px; font-weight: 800; color: var(--vdp-primary); }
.plan-card__features { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.plan-card__features li { padding: 4px 0; }

/* Drag & drop ---------------------------------------------------------------- */
.sortable-row { cursor: default; }
.drag-handle { color: #8c9196; cursor: grab; display: inline-flex; }
.drag-handle:active { cursor: grabbing; }

/* Auth pages ----------------------------------------------------------------- */
.auth-page {
    background: linear-gradient(160deg, #0b3b2c 0%, #006e52 45%, #008060 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 24px;
}
.auth-wrap { width: 100%; max-width: 460px; }
.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
    text-align: center;
}
.auth-card__mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--vdp-primary);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 18px;
}
.auth-card__mark--error { background: var(--vdp-danger); }
.auth-card__title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.auth-card__text { color: var(--vdp-text-subtle); font-size: 14px; margin-bottom: 22px; }
.auth-card__note { margin-top: 22px; font-size: 12.5px; }
.auth-card__note a { color: var(--vdp-primary); text-decoration: none; }

/* Pagination ----------------------------------------------------------------- */
.pagination { --bs-pagination-active-bg: var(--vdp-primary); --bs-pagination-active-border-color: var(--vdp-primary); --bs-pagination-color: var(--vdp-text); --bs-pagination-font-size: 13px; margin-bottom: 0; }

/* RTL ------------------------------------------------------------------------ */
[dir="rtl"] .admin-sidebar { border-right: 0; }
[dir="rtl"] .admin-toast { right: auto; left: 24px; }
[dir="rtl"] .text-end { text-align: left !important; }

/* Dark mode (media based) ---------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    body.admin-body { background: #0b0b0c; color: #e3e3e3; }
    .admin-card, .admin-topbar { background: #1b1b1d; border-color: #333; }
    .admin-table thead th { background: #222; color: #9a9a9c; }
    .admin-table tbody tr:hover { background: #222; }
    .admin-table tbody td { border-color: #2a2a2c; }
    .status-item, .activity-feed__item { border-color: #2c2c2e; }
    .shop-pill { background: #222; color: #e3e3e3; border-color: #333; }
    .admin-card__header { border-color: #2a2a2c; }
    .preview-frame { background: #151517; }
    .admin-pre { background: #151517; border-color: #333; }
    .skeleton-cell { background: linear-gradient(90deg, #262628 25%, #333 50%, #262628 75%); background-size: 200% 100%; }
    .admin-tabs { border-color: #333; }
    .admin-tabs .nav-link.active { background: #173a2d; }
    .admin-empty__icon { background: #262628; }
    .btn-outline-secondary { --bs-btn-color: #b5b5b6; --bs-btn-border-color: #555; }
    .text-muted { color: #9a9a9c !important; }
    .form-control, .form-select { background-color: #1b1b1d; color: #e3e3e3; border-color: #444; }
    .form-control:focus, .form-select:focus { background-color: #1b1b1d; color: #e3e3e3; }
}