/* ============================================================
   PawEra Admin — Dark Refined Theme
   ============================================================ */

:root {
    --bg-deep: #0c0c0f;
    --bg-base: #111116;
    --bg-card: #18181e;
    --bg-elevated: #1e1e26;
    --bg-hover: #252530;
    --bg-input: #15151b;

    --border: #2a2a35;
    --border-subtle: #1f1f28;

    --text-primary: #eaeaf0;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --text-inverse: #0c0c0f;

    --accent: #e8a844;
    --accent-hover: #f0b85c;
    --accent-muted: #c48a30;
    --accent-glow: rgba(232, 168, 68, 0.15);
    --accent-bg: rgba(232, 168, 68, 0.08);

    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.1);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);

    --sidebar-width: 260px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Light Theme ==================== */

[data-theme="light"] {
    --bg-deep: #f0f0f5;
    --bg-base: #f5f5fa;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #eeeef3;
    --bg-input: #f0f0f5;

    --border: #d5d5e0;
    --border-subtle: #e0e0ea;

    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8888a0;
    --text-inverse: #ffffff;

    --accent: #d49530;
    --accent-hover: #c48620;
    --accent-muted: #b07820;
    --accent-glow: rgba(212, 149, 48, 0.15);
    --accent-bg: rgba(212, 149, 48, 0.08);

    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.1);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ==================== Reset ==================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ==================== Screens ==================== */

.screen {
    display: none;
    width: 100%;
    height: 100vh;
}

.screen.active {
    display: flex;
}

/* ==================== Login ==================== */

#login-screen {
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-glow) 0%, transparent 60%),
        var(--bg-deep);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 0 24px;
}

.login-brand {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeSlideDown 0.6s ease-out;
}

.brand-icon {
    margin-bottom: 16px;
    opacity: 0.9;
}

.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 4px;
}

.login-step {
    display: none;
    animation: fadeSlideUp 0.35s ease-out;
}

.login-step.active {
    display: block;
}

.otp-header {
    margin-bottom: 20px;
}

.otp-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

/* ==================== Inputs ==================== */

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Fix native date/select icons invisible in dark theme */
input,
select {
    color-scheme: dark;
}

[data-theme="light"] input,
[data-theme="light"] select {
    color-scheme: light;
}

/* ==================== Buttons ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 168, 68, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #ef4444;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-success:hover:not(:disabled) {
    background: #2dd38d;
}

.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }

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

.btn.loading .btn-text { opacity: 0; }
.btn.loading .btn-loader { display: block; }

.btn-loader {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ==================== Sidebar ==================== */

#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
}

.nav-item.active svg {
    stroke: var(--accent);
}

.nav-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 16px 16px 4px;
    user-select: none;
}

.nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 10px 14px;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sidebar-footer-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.sidebar-footer .version-label {
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    opacity: 0.6;
    padding: 0;
}

.admin-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== Main Content ==================== */

#main-content {
    flex: 1;
    overflow-y: auto;
    background:
        radial-gradient(ellipse 60% 40% at 80% 0%, rgba(232, 168, 68, 0.03) 0%, transparent 50%),
        var(--bg-deep);
}

#page-container {
    padding: 32px;
    max-width: 1400px;
    animation: fadeIn 0.3s ease-out;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ==================== Stat Cards ==================== */

.dashboard-section {
    margin-bottom: 36px;
}

.dashboard-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.info .stat-value { color: var(--info); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger .stat-value { color: var(--danger); }

/* ==================== Cards / Sections ==================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 22px;
}

.card-body.no-pad {
    padding: 0;
    overflow-x: auto;
}

/* ==================== Data Table ==================== */

.table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-controls .input-group {
    margin-bottom: 0;
}

.table-controls input,
.table-controls select {
    padding: 8px 12px;
    font-size: 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
}

.table-controls input:focus,
.table-controls select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.table-controls select {
    min-width: 140px;
}

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

.data-table th {
    text-align: left;
    padding: 12px 18px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 18px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 52px;
    vertical-align: middle;
}

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

.data-table tr:hover td {
    background: var(--bg-hover);
}

.data-table .uid-cell {
    font-family: 'DM Sans', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 120px;
}

/* ==================== Status Badges ==================== */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-active, .badge-confirmed { background: var(--success-bg); color: var(--success); }
.badge-rejected, .badge-cancelled, .badge-expired { background: var(--danger-bg); color: var(--danger); }
.badge-in_progress { background: var(--info-bg); color: var(--info); }
.badge-completed { background: var(--success-bg); color: var(--success); }
.badge-deleted { background: rgba(100,100,120,0.15); color: var(--text-muted); }
.badge-suspended { background: rgba(245,158,11,0.12); color: #f59e0b; }
.badge-refunded { background: rgba(168,85,247,0.12); color: #a855f7; }
.badge-released { background: var(--info-bg); color: var(--info); }
.badge-failed { background: var(--danger-bg); color: var(--danger); }

.reported-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.rating-detail-btn {
    min-width: auto;
    padding: 2px 6px;
    font-size: 1rem;
    line-height: 1;
}

/* ==================== Pagination ==================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid var(--border-subtle);
}

.pagination-info {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pagination-btns {
    display: flex;
    gap: 8px;
}

/* ==================== Walkie Application Cards ==================== */

.walkie-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.walkie-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: all var(--transition);
}

.walkie-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.walkie-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.walkie-card-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.walkie-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.walkie-card-uid {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.walkie-card-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.walkie-card-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.walkie-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.walkie-card-actions {
    display: flex;
    gap: 10px;
}

/* ==================== Dev Tools ==================== */

.devtools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.devtool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.devtool-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.devtool-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.devtool-card .badge {
    margin-bottom: 12px;
}

/* ==================== Status Breakdown ==================== */

.status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.status-row-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    min-width: 140px;
    flex-shrink: 0;
}

.status-row-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-bar-container {
    flex: 1;
    margin: 0 16px;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
}

.status-bar {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.6s ease-out;
}

/* ==================== Empty States ==================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.92rem;
}

/* ==================== Toast ==================== */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 0.88rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 380px;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info { border-left: 3px solid var(--info); }

.toast.removing {
    animation: toastOut 0.25s ease-in forwards;
}

/* ==================== Confirm Dialog ==================== */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.overlay.active {
    display: flex;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease-out;
}

.confirm-dialog h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.confirm-dialog p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==================== Loading ==================== */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.loading-spinner::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ==================== Animations ==================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ==================== Stagger Animation for Cards ==================== */

.stagger-in > * {
    animation: fadeSlideUp 0.4s ease-out both;
}

.stagger-in > *:nth-child(1) { animation-delay: 0s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.25s; }

/* ==================== Scrollbar ==================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== Rating Stars ==================== */

.stars {
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* ==================== Detail Modal ==================== */

.detail-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease-out;
}

.detail-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.detail-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-modal-close {
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 8px;
    min-width: auto;
}

.detail-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ==================== Detail Grid ==================== */

.detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1px;
    background: var(--border-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.detail-grid dt {
    padding: 10px 14px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-grid dd {
    padding: 10px 14px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.88rem;
    word-break: break-all;
}

/* ==================== Verify Toggle ==================== */

.verify-toggle {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.verify-toggle:hover {
    background: var(--bg-hover);
}

.verify-toggle.verified {
    color: var(--success);
}

.verify-toggle.not-verified {
    color: var(--text-muted);
}

.verify-toggle.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== Scope Badges ==================== */

.scope-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 500;
    background: var(--bg-elevated);
    color: var(--text-muted);
    margin: 2px;
    border: 1px solid var(--border-subtle);
}

.scope-badge.admin {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent;
}

.scope-badge.walkie {
    background: var(--info-bg);
    color: var(--info);
    border-color: transparent;
}

.scope-badge.account {
    background: var(--success-bg);
    color: var(--success);
    border-color: transparent;
}

/* ==================== Email Preview ==================== */

.email-preview-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    height: calc(100vh - 180px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.email-list {
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
}

.email-list-item {
    padding: 12px 18px;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.email-list-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.email-list-item.active {
    background: var(--accent-bg);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

.email-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #f4f4f4;
}

/* ==================== Config Page ==================== */

.config-section {
    margin-bottom: 32px;
}

.config-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
}

.config-card h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.config-card ul {
    list-style: none;
    padding: 0;
}

.config-card li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0;
}

/* ==================== Config Tabs ==================== */

.info-box {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--accent-bg);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

[data-theme="light"] .info-box {
    background: rgba(212, 149, 48, 0.08);
    border-left-color: var(--accent);
}

.config-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0;
}

.config-tab {
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
    cursor: pointer;
}

.config-tab:hover {
    color: var(--text-primary);
}

.config-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.config-tab-panel {
    display: none;
    animation: fadeSlideUp 0.3s ease-out;
}

.config-tab-panel.active {
    display: block;
}

/* ==================== Settings Form ==================== */

.settings-group {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-group-title {
    padding: 14px 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.setting-row {
    display: grid;
    grid-template-columns: 1fr 200px;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.setting-row input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    text-align: right;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.setting-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ==================== Config Section Panels ==================== */

.config-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.config-panel-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background var(--transition);
}

.config-panel-header:hover {
    background: var(--bg-hover);
}

.config-panel-header h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.config-panel-toggle {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.config-panel.open .config-panel-toggle {
    transform: rotate(180deg);
}

.config-panel-body {
    display: none;
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
}

.config-panel.open .config-panel-body {
    display: block;
}

/* ==================== Enum List Editor ==================== */

.enum-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.enum-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.enum-item-id {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
    min-width: 80px;
}

.enum-item-label {
    flex: 1;
    color: var(--text-secondary);
}

.enum-item .flag-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
}

/* ==================== Service Cards ==================== */

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.service-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.service-card-icon {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.service-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.service-card-id {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.service-card-species {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.species-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--accent-bg);
    color: var(--accent);
}

/* ==================== Config Save Bar ==================== */

.config-save-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 0;
    margin-top: 8px;
}

.config-save-bar .btn {
    min-width: 140px;
}

/* ==================== Config Species Select ==================== */

.config-species-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.config-species-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition);
}

.config-species-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.config-species-btn.active {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent);
}

/* ==================== Clickable Table Rows ==================== */

.data-table tr.clickable {
    cursor: pointer;
}

.data-table tr.clickable:hover td {
    background: var(--accent-bg);
}

/* ==================== Detail Section ==================== */

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ==================== Stat Sub-text ==================== */

.stat-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================== Actions Cell ==================== */

.actions-cell {
    white-space: nowrap;
    vertical-align: middle;
}
.actions-cell .btn {
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

.btn-icon {
    padding: 4px 6px;
    font-size: 0.9rem;
    line-height: 1;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

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

/* ==================== Mobile Header & Hamburger ==================== */

#mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

#hamburger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

#hamburger-btn:hover {
    background: var(--bg-hover);
}

.mobile-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
}

#sidebar-overlay.active {
    display: block;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    #mobile-header {
        display: flex;
    }

    #app-screen {
        flex-direction: column;
    }

    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        width: var(--sidebar-width);
    }

    #sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    #page-container {
        padding: 20px;
    }

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

/* ==================== Profile Page ==================== */

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 700px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
}

/* ==================== Edit Form ==================== */

.edit-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.edit-form .input-group {
    margin-bottom: 0;
}

.edit-form .input-group.full-width {
    grid-column: 1 / -1;
}

.edit-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.edit-form .input-group input,
.edit-form .input-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.edit-form .input-group input:focus,
.edit-form .input-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.edit-form .input-group input:read-only {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Editable Config Rows ==================== */

.editable-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.editable-row input {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}
.editable-row input:focus {
    border-color: var(--accent);
}
.editable-row input:read-only {
    opacity: 0.5;
    cursor: not-allowed;
}
.editable-row .edit-id {
    width: 120px;
    flex-shrink: 0;
}
.editable-row .edit-en,
.editable-row .edit-el {
    flex: 1;
    min-width: 100px;
}
.btn-danger-subtle {
    color: var(--danger) !important;
    border-color: transparent !important;
}
.btn-danger-subtle:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}
.add-row-btn,
.add-species-row-btn {
    margin-top: 8px;
}

/* ==================== Service Edit Cards ==================== */

.service-edit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.service-edit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}
.service-edit-row {
    margin-bottom: 10px;
}
.service-edit-row label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}
.service-edit-row input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}
.service-edit-row input:focus {
    border-color: var(--accent);
}
.service-edit-row input:read-only {
    opacity: 0.5;
    cursor: not-allowed;
}
.species-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.species-check {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.species-check input[type="checkbox"] {
    width: auto;
}
.remove-service-btn {
    margin-top: 8px;
    width: 100%;
}

/* ==================== Translations Editor ==================== */

.translations-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.translations-toolbar .lang-tabs {
    display: flex;
    gap: 4px;
}
.translations-toolbar .lang-tab {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition);
}
.translations-toolbar .lang-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.translations-search {
    flex: 1;
    min-width: 200px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}
.translations-search:focus {
    border-color: var(--accent);
}
.translation-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.translation-row:hover {
    background: var(--bg-hover);
}
.translation-key {
    width: 340px;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    padding-top: 8px;
    word-break: break-all;
}
.translation-value {
    flex: 1;
}
.translation-value input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}
.translation-value input:focus {
    border-color: var(--accent);
}
.translations-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.translations-header-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.translation-key-header {
    width: 340px;
    flex-shrink: 0;
}
.translations-header-row .translation-lang-header {
    flex: 1;
    min-width: 150px;
}

/* ==================== Species Chips ==================== */

.species-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==================== Icon Picker ==================== */

.icon-picker-wrapper { position: relative; display: inline-block; }
.icon-picker-btn {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.icon-picker-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.icon-picker-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 240px;
    margin-top: 4px;
}
.icon-picker-popup.open { display: grid; }
.icon-option {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.icon-option:hover { background: var(--bg-hover); }
.icon-option.selected { background: var(--accent-bg); outline: 2px solid var(--accent); }

/* Monochrome service icons (SVG-based picker) */
.icon-picker-btn svg,
.icon-option svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    display: block;
}

/* ── Service color (pastel) picker ── */
.svc-color-picker { display: inline-block; }
.svc-color-row { width: max-content; }
.svc-color-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border: 1.5px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
}
.svc-color-swatch:hover { background: var(--bg-hover); }
.svc-color-swatch.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.svc-img-thumb {
    width: 72px;
    height: 52px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: var(--bg-elevated);
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.svc-img-thumb:hover {
    border-color: var(--accent-muted);
    transform: scale(1.04);
}

.svc-img-thumb.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

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

.svc-main-toggle {
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.svc-main-toggle.on {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* ==================== Duration Slider ==================== */

input[type="range"].svc-max-duration,
input[type="range"].slider-mb {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    border: none;
    padding: 0;
    margin-top: 6px;
    cursor: pointer;
    background: var(--border);
}
input[type="range"].svc-max-duration::-webkit-slider-thumb,
input[type="range"].slider-mb::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0,0,0,0.2);
    transition: box-shadow 0.15s;
}
input[type="range"].svc-max-duration::-webkit-slider-thumb:hover,
input[type="range"].slider-mb::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.2);
}
input[type="range"].svc-max-duration::-moz-range-thumb,
input[type="range"].slider-mb::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 3px solid var(--bg-card);
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0,0,0,0.2);
}
input[type="range"].svc-max-duration::-moz-range-progress,
input[type="range"].slider-mb::-moz-range-progress {
    background: var(--accent);
    border-radius: 4px;
    height: 8px;
}

/* ==================== Photo Gallery ==================== */

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.photo-gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
}

.photo-gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-gallery-thumb:hover {
    transform: scale(1.05);
}

.photo-profile-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--accent);
    color: var(--text-inverse);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
}

.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.photo-gallery-item:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background: rgba(220, 53, 69, 1);
}

/* ==================== Chip Selectors (Settings) ==================== */

.setting-row-chips {
    grid-template-columns: 1fr;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip-option {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.chip-option:hover {
    border-color: var(--accent-muted);
    color: var(--text-primary);
}

.chip-option.active {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}

/* ============================================================
   Promo Form — templates strip + preview card
   ============================================================ */

.promo-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.promo-tpl-label {
    width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.promo-tpl-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}

.promo-tpl-btn:hover {
    border-color: var(--accent-muted);
    color: var(--text-primary);
}

/* ---------- Live preview shell ---------- */

.promo-preview-wrap {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    margin: 0 -16px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.promo-preview-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* Collapsible advanced sections — progressive disclosure to keep the form
   focused on Style / Preview / Text / Media by default. */
.promo-adv {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: var(--bg-input);
    overflow: hidden;
}
.promo-adv__summary {
    cursor: pointer;
    list-style: none;
    padding: 11px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
    user-select: none;
}
.promo-adv__summary::-webkit-details-marker { display: none; }
.promo-adv__summary::before {
    content: '\25B8';
    font-size: 0.72rem;
    transition: transform 0.15s ease;
    color: var(--text-muted);
}
.promo-adv[open] > .promo-adv__summary::before { transform: rotate(90deg); }
.promo-adv__hint { font-weight: 400; color: var(--text-muted); }
.promo-adv__body {
    padding: 2px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Base card — 16:9 at 320px wide */
.promo-prev {
    position: relative;
    width: 320px;
    height: 180px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px 18px;
    box-sizing: border-box;
    font-family: inherit;
    /* default fallback */
    background: #1e1e26;
}

.promo-prev__eyebrow {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 4px;
}

.promo-prev__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}

.promo-prev__subtitle {
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.85;
    margin-bottom: 10px;
}

.promo-prev__cta {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    align-self: flex-start;
    white-space: nowrap;
}

/* Circular photo thumbnail for left-photo styles (03 warm peach, 08 soft
   surface) — keeps the solid background so the title/subtitle stay legible. */
.promo-prev__photo {
    position: absolute;
    top: 16px;
    left: 18px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 2;
}

/* Decoration shapes reused across styles */
.promo-prev__deco {
    position: absolute;
    pointer-events: none;
}

/* ── Style 01: Gradient hero ── */
.promo-prev--01 {
    background: linear-gradient(135deg, #2E6B57, #2C7657);
    color: #ffffff;
}
.promo-prev--01 .promo-prev__title,
.promo-prev--01 .promo-prev__subtitle { color: #ffffff; }
.promo-prev--01 .promo-prev__cta { background: #ffffff; color: #2E6B57; }

/* ── Style 02: Mint pop ── */
.promo-prev--02 {
    background: linear-gradient(135deg, #00BC8C, #006C4F);
    color: #004431;
}
.promo-prev--02 .promo-prev__title,
.promo-prev--02 .promo-prev__subtitle { color: #004431; }
.promo-prev--02 .promo-prev__cta { background: #ffffff; color: #006C4F; }

/* ── Style 03: Cozy peach ── */
.promo-prev--03 {
    background: #FFF4E9;
    color: #7F471C;
}
.promo-prev--03 .promo-prev__title,
.promo-prev--03 .promo-prev__subtitle { color: #7F471C; }
.promo-prev--03 .promo-prev__cta { background: #FB9F08; color: #161D1A; }

/* ── Style 04: Minimal ── */
.promo-prev--04 {
    background: #ffffff;
    border: 1px solid #E9EDF0;
    color: #161D1A;
}
.promo-prev--04 .promo-prev__title { color: #161D1A; }
.promo-prev--04 .promo-prev__subtitle { color: #6C7A72; }
.promo-prev--04 .promo-prev__cta { background: #2E6B57; color: #ffffff; }

/* ── Style 05: Photo overlay ── */
.promo-prev--05 {
    background: linear-gradient(135deg, #2C7657, #48DEAC);
    color: #ffffff;
}
.promo-prev--05::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,68,49,0.9) 0%, transparent 60%);
}
.promo-prev--05 .promo-prev__eyebrow,
.promo-prev--05 .promo-prev__title,
.promo-prev--05 .promo-prev__subtitle { position: relative; z-index: 1; color: #ffffff; }
.promo-prev--05 .promo-prev__cta {
    position: relative; z-index: 1;
    background: transparent;
    border: 1.5px solid #ffffff;
    color: #ffffff;
}

/* ── Style 06: Split panel ── */
.promo-prev--06 {
    background: #ffffff;
    color: #161D1A;
}
.promo-prev--06 .promo-prev__title { color: #161D1A; }
.promo-prev--06 .promo-prev__subtitle { color: #404944; }
.promo-prev--06 .promo-prev__cta { background: #2E6B57; color: #ffffff; }
.promo-prev--06 .promo-prev__deco {
    top: 0; right: 0;
    width: 38%; height: 100%;
    background: #DFECE7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.promo-prev--06 .promo-prev__badge {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(46,107,87,0.15);
    border: 2px solid #2E6B57;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 800; color: #2E6B57;
}

/* ── Style 07: Coupon ticket ── */
.promo-prev--07 {
    background: #F4F9F5;
    border: 1px dashed #2E6B57;
    color: #161D1A;
}
.promo-prev--07 .promo-prev__title { color: #161D1A; }
.promo-prev--07 .promo-prev__subtitle { color: #404944; }
.promo-prev--07 .promo-prev__cta { background: #2E6B57; color: #ffffff; }
.promo-prev--07 .promo-prev__deco {
    top: 14px; right: 14px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #FB9F08;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800; color: #ffffff;
}

/* ── Style 08: Soft surface ── */
.promo-prev--08 {
    background: #E8F0EA;
    color: #161D1A;
}
.promo-prev--08 .promo-prev__title { color: #161D1A; }
.promo-prev--08 .promo-prev__subtitle { color: #404944; }
.promo-prev--08 .promo-prev__cta { background: #2E6B57; color: #ffffff; }

/* ── Style 09: Illustrated playful ── */
.promo-prev--09 {
    background: #F4FBF5;
    color: #161D1A;
}
.promo-prev--09 .promo-prev__title { color: #161D1A; }
.promo-prev--09 .promo-prev__subtitle { color: #404944; }
.promo-prev--09 .promo-prev__cta { background: #2E6B57; color: #ffffff; }
.promo-prev--09 .promo-prev__deco {
    top: 10px; right: 10px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(46,107,87,0.12);
    border: 2px solid #48DEAC;
}
.promo-prev--09 .promo-prev__deco::after {
    content: '';
    position: absolute;
    top: 12px; left: 12px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #FB9F08;
    opacity: 0.5;
}

/* ── Style 10: Calm notice ── */
.promo-prev--10 {
    background: #ECF6FE;
    color: #161D1A;
}
.promo-prev--10 .promo-prev__title { color: #161D1A; }
.promo-prev--10 .promo-prev__subtitle { color: #404944; }
.promo-prev--10 .promo-prev__cta { background: #BFDEFB; color: #004431; }
.promo-prev--10 .promo-prev__deco {
    top: 14px; right: 14px;
    width: 30px; height: 30px;
    border-radius: 6px;
    background: #228BE6;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; color: #ffffff; font-weight: 800;
}

/* ============================================================
   Promo V2 — Icon picker, Color picker, Image picker, Preview extras
   ============================================================ */

/* ── Icon grid ── */
.promo-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 4px;
    padding: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 180px;
    overflow-y: auto;
}

.promo-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    min-height: 52px;
    font-size: 0;
}

.promo-icon-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.promo-icon-item.selected {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent);
}

.promo-icon-none {
    color: var(--text-muted);
    font-size: 0.65rem !important;
}

.promo-icon-label {
    font-size: 0.58rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52px;
    color: inherit;
    display: block;
}

/* ── Accent color swatches ── */
.promo-accent-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.promo-accent-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 6px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 44px;
}

.promo-accent-swatch:hover {
    background: var(--bg-hover);
}

.promo-accent-swatch.selected {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.promo-accent-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    display: block;
    flex-shrink: 0;
}

.promo-accent-none .promo-accent-circle {
    border: 1.5px dashed var(--text-muted);
    background: transparent !important;
}

.promo-accent-name {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
}

/* ── Image picker ── */
.promo-img-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 176px;
    overflow-y: auto;
    padding: 2px 4px 2px 2px;
}

.promo-img-thumb {
    width: 72px;
    height: 52px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: var(--bg-elevated);
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.promo-img-thumb:hover {
    border-color: var(--accent-muted);
    transform: scale(1.04);
}

.promo-img-thumb.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

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

.promo-img-preview-thumb {
    margin-top: 6px;
    width: 120px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

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

/* ── Preview extras ── */
.promo-prev__chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 10px;
    background: #FB9F08;
    color: #fff;
    margin-bottom: 4px;
    align-self: flex-start;
}

.promo-prev__icon {
    margin-bottom: 4px;
    opacity: 0.85;
    align-self: flex-start;
}

/* Rosette badge (style 02) */
.promo-prev__deco--rosette {
    top: 10px; right: 10px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #FB9F08;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800; color: #fff;
}

/* Photo hint (style 05 no image) */
.promo-prev__deco--photo-hint {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.2;
}

/* Style 01 badge */
.promo-prev__deco--badge01 {
    top: 10px; right: 10px;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800; color: rgba(255,255,255,0.85);
}

/* Split panel (style 06) */
.promo-prev__deco--splitpanel {
    top: 0; right: 0;
    width: 38%; height: 100%;
    background: #DFECE7;
    display: flex; align-items: center; justify-content: center;
}

/* Coupon stub (style 07) */
.promo-prev__deco--coupon-stub {
    position: absolute;
    top: 0; right: 0;
    width: 44px;
    height: 100%;
    background: #FB9F08;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.promo-prev__coupon-pct {
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.promo-prev__coupon-off {
    font-size: 0.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.05em;
}

/* Style 09 circle */
.promo-prev__deco--circle09 {
    top: 10px; right: 10px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(46,107,87,0.1);
    border: 2px solid #48DEAC;
    display: flex; align-items: center; justify-content: center;
}

/* Style 10 info badge */
.promo-prev__deco--info10 {
    top: 14px; right: 14px;
    width: 28px; height: 28px;
    border-radius: 6px;
    background: #228BE6;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.88rem; color: #ffffff; font-weight: 800;
}

/* ==================== Info Icon + Body Tooltip ==================== */

.info-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    color: var(--text-muted);
    cursor: help;
    vertical-align: middle;
    line-height: 0;
    border-radius: 50%;
    outline: none;
}

.info-ico:hover,
.info-ico:focus-visible {
    color: var(--accent);
}

#info-tip {
    position: fixed;
    z-index: 99999;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-elevated, #1e1e26);
    color: var(--text-primary, #eaeaf0);
    font-size: 0.72rem;
    line-height: 1.4;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s;
}

#info-tip.show {
    opacity: 1;
    visibility: visible;
}

/* ==================== Walker photo (click to replace) ==================== */
/* The thumbnail IS the control: the client asked to change a walker's picture as directly as
   possible, so there is no row menu and no edit screen between the two. */
.walker-photo {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.walker-photo-initial {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Only announces itself on hover — forty rows each shouting "Change" would be noise. */
.walker-photo-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.walker-photo:hover .walker-photo-overlay,
.walker-photo:focus-visible .walker-photo-overlay {
    opacity: 1;
}

.walker-photo.is-uploading {
    pointer-events: none;
}

.walker-photo.is-uploading .walker-photo-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.walker-photo.is-uploading .walker-photo-overlay::after {
    content: '…';
}

.walker-photo.is-uploading .walker-photo-overlay {
    font-size: 0;
}

.walker-photo.is-uploading .walker-photo-overlay::after {
    font-size: 1rem;
}
