:root {
    --primary: #28a745;
    --primary-dark: #218838;
    --dark: #1a1a1a;
    --dark-light: #2d2d2d;
    --orange: #ff9800;
    --bg: #f8f9fa;
    --white: #ffffff;
    --text: #333;
    --text-muted: #666;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

html { overflow-x: clip; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    overflow-x: clip;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.main-content {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

/* Header */
.site-header {
    background: var(--dark);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner,
.header-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 12px;
    min-width: 0;
}

.site-header-bar {
    background: var(--dark);
}

.header-bar-inner {
    flex-wrap: nowrap;
}

.header-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    min-width: 0;
    gap: 16px;
}

.main-nav {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.nav-toggle,
.header-balance-mobile,
.nav-backdrop {
    display: none;
}

.nav-toggle {
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-toggle i { font-size: 1.15rem; }
.nav-toggle-close { display: none; }

body.nav-open .nav-toggle-open { display: none; }
body.nav-open .nav-toggle-close { display: block; }

.header-balance-mobile {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-balance-mobile i { margin-right: 4px; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: var(--white);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
}

.logo i { color: var(--primary); font-size: 1.6rem; }

.main-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.main-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: color 0.2s;
    white-space: nowrap;
}
.main-nav a i { margin-right: 4px; font-size: 0.8rem; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }


.balance-badge {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.currency-picker { position: relative; }
.currency-badge.currency-picker-btn {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(124, 58, 237, 0.35);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.currency-badge.currency-picker-btn:hover {
    background: rgba(124, 58, 237, 0.2);
}
.currency-picker.open .currency-picker-btn i {
    transform: rotate(180deg);
}
.currency-picker-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 8px;
}
.currency-picker-title {
    margin: 0 0 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}
.currency-picker-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
    gap: 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    align-items: center;
}
.currency-picker-item span {
    grid-row: span 2;
    font-size: 1.1rem;
}
.currency-picker-item strong { font-size: 0.9rem; }
.currency-picker-item small {
    grid-column: 2;
    color: var(--text-muted);
    font-size: 0.72rem;
}
.currency-picker-item:hover { background: var(--bg); }
.currency-picker-item.active {
    background: rgba(124, 58, 237, 0.1);
    color: #6d28d9;
}

.user-type-badge {
    background: rgba(40,167,69,0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.commission-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -8px 0 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.3); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: rgba(255,255,255,0.7); border: none; }
.btn-ghost:hover { color: var(--white); }
.btn-danger { background: #dc3545; color: white; border-color: #dc3545; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-order {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-order:hover { background: var(--primary-dark); }

/* Hero / slider / mobile menu — black + green surface */
.hero-surface,
.hero-bg {
    position: relative;
    overflow: hidden;
    background-color: #141816;
    background-image:
        linear-gradient(160deg, rgba(40, 167, 69, 0.18) 0%, transparent 42%),
        linear-gradient(220deg, rgba(40, 167, 69, 0.1) 0%, transparent 38%),
        linear-gradient(135deg, #0f1210 0%, #1a1f1c 45%, #1e2420 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%;
}

.hero-surface::before,
.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% -15%, rgba(40, 167, 69, 0.35), transparent 55%),
        radial-gradient(ellipse 45% 35% at 95% 60%, rgba(40, 167, 69, 0.12), transparent),
        radial-gradient(ellipse 40% 30% at 5% 75%, rgba(40, 167, 69, 0.1), transparent);
    pointer-events: none;
    z-index: 0;
}

.hero-surface::after,
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/hero-bg-pattern.svg');
    background-size: cover;
    background-position: center;
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
}

.hero-bg > .container,
.hero-bg > .hero-slide,
.hero-bg > .slider-dots {
    position: relative;
    z-index: 1;
}

.hero-slider {
    padding: 60px 0 40px;
}

.hero-slider.has-custom-slides {
    padding: 0;
    position: relative;
}

.hero-slider.has-custom-slides .hero-slide {
    display: none;
    position: relative;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    padding: 56px 0 48px;
    background-image: linear-gradient(rgba(10, 14, 12, 0.62), rgba(10, 14, 12, 0.72)), var(--slide-bg);
    background-size: cover;
    background-position: center;
}

.hero-slider.has-custom-slides .hero-slide.active {
    display: flex;
    flex-direction: column;
}

.hero-slide-overlay {
    display: none;
}

.hero-slider.has-custom-slides .slider-dots {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    z-index: 2;
    margin-top: 0;
}

.hero-slider.has-custom-slides .slider-dots span {
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.hero-slider.has-custom-slides .slider-dots span:hover {
    transform: scale(1.15);
}

.hero-content { text-align: center; color: white; position: relative; z-index: 1; }
.hero-content h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.hero-content p {
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 24px;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.slider-dots span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
}
.slider-dots span.active { background: var(--primary); }

.slider-admin-thumb {
    width: 72px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.slider-edit-preview {
    margin-top: 8px;
}
.slider-edit-preview img {
    max-width: 200px;
    max-height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.inline-delete-form { display: inline; }

/* Sections */
.services-section {
    padding: 40px 0;
    width: 100%;
    max-width: 100%;
}
.services-section.bg-light { background: var(--white); }

.section-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

/* Service Grid & Cards */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.service-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
}

.service-card .btn-order {
    flex-shrink: 0;
    align-self: center;
}

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

.service-icon {
    width: 44px; height: 44px;
    background: rgba(40,167,69,0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-icon i { font-size: 1.2rem; }
.service-icon i.fa-mobile-alt { color: #28a745; }
.service-icon i.fa-server { color: #0d6efd; }
.service-icon i.fa-laptop { color: #6f42c1; }
.service-icon i:not(.fa-mobile-alt):not(.fa-server):not(.fa-laptop) { color: var(--primary); }
.service-icon-lg i.fa-mobile-alt { color: #28a745; }
.service-icon-lg i.fa-server { color: #0d6efd; }
.service-icon-lg i.fa-laptop { color: #6f42c1; }
.service-icon-lg i:not(.fa-mobile-alt):not(.fa-server):not(.fa-laptop) { color: var(--primary); }
.icon-thumb i.fa-mobile-alt { color: #28a745; }
.icon-thumb i.fa-server { color: #0d6efd; }
.icon-thumb i.fa-laptop { color: #6f42c1; }
.service-icon .service-photo,
.service-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.service-info { flex: 1; min-width: 0; }

.service-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.service-price {
    color: var(--orange);
    font-weight: 700;
    font-size: 1rem;
}

.service-time {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Features */
.features-section { padding: 50px 0; background: var(--white); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: center;
}
.feature-card i { font-size: 2.5rem; color: var(--primary); margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: white;
    padding: 36px 0 32px;
    position: relative;
}
.page-header .container {
    text-align: center;
    position: relative;
    z-index: 1;
}

.page-header h1 {
    margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.page-header p {
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.page-header.hero-bg h1 { margin-bottom: 10px; }
.page-header.hero-bg p { margin: -4px 0 0; }

.search-form {
    display: flex;
    gap: 10px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}
.search-form input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.services-toolbar-form,
.admin-services-toolbar .admin-order-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}
.services-toolbar-form input[type="search"],
.services-toolbar-form .services-type-select,
.admin-services-toolbar .services-type-select {
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
}
.services-toolbar-form input[type="search"] {
    flex: 1 1 180px;
    min-width: 140px;
}
.services-toolbar-form .services-type-select,
.admin-services-toolbar .services-type-select {
    flex: 0 0 auto;
    min-width: 130px;
    border: 1px solid var(--border);
    background: #fff;
}
.admin-services-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
}
.admin-services-toolbar .admin-order-search-form {
    justify-content: flex-start;
    margin: 0;
    max-width: none;
    flex: 1 1 320px;
}
.admin-services-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-bar { background: var(--white); border-bottom: 1px solid var(--border); padding: 12px 0; }
.filter-bar .container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
.filter-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.filter-divider { color: var(--border); margin: 0 4px; }
.filter-bar a {
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.filter-bar a.active, .filter-bar a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Order Page */
.order-page { padding: 40px 0; }
.order-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.order-header { display: flex; gap: 20px; margin-bottom: 24px; align-items: flex-start; }
.service-icon-lg {
    width: 60px; height: 60px;
    background: rgba(40,167,69,0.1);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.service-icon-lg i { font-size: 1.8rem; color: var(--primary); }
.service-icon-lg .service-photo-lg {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
}
.order-price { color: var(--orange); font-size: 1.4rem; font-weight: 700; margin-top: 8px; }
.order-info {
    background: var(--bg);
    padding: 14px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.balance-info {
    background: rgba(40,167,69,0.08);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    color: var(--primary);
}
.order-stock-alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.order-stock-alert p { margin: 6px 0 0; font-size: 0.85rem; opacity: 0.9; }
.order-stock-in {
    background: rgba(40, 167, 69, 0.08);
    border: 1px solid rgba(40, 167, 69, 0.25);
    color: var(--primary);
}
.order-stock-out {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #c62828;
}
.order-stock-out strong { display: block; font-size: 1rem; margin-top: 4px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40,167,69,0.15);
}
.form-group small { color: var(--text-muted); font-size: 0.85rem; }

/* Auth */
.auth-page { padding: 60px 0; min-height: 60vh; display: flex; align-items: center; }
.auth-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    max-width: 420px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}
.auth-card h1 { text-align: center; margin-bottom: 24px; }
/* btn-outline defaults to white text (header); on white cards it must be dark */
.auth-card .btn-outline {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 600;
}
.auth-card .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdf4;
}
.auth-card .install-success-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.auth-card .install-success-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.auth-card .install-admin-btn {
    border-color: #7c3aed;
    color: #5b21b6;
}
.auth-card .install-admin-btn:hover {
    background: #f5f3ff;
    border-color: #6d28d9;
    color: #4c1d95;
}
.auth-link { text-align: center; margin-top: 16px; font-size: 0.9rem; }
.auth-link a { color: var(--primary); }
.auth-link.auth-forgot { margin-top: 10px; }
.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: -12px 0 20px;
    line-height: 1.5;
}

/* Dashboard */
.dashboard-page { padding: 40px 0; }
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}
.balance-card {
    background: var(--primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 14px;
}
.balance-card i { font-size: 1.8rem; }
.balance-card span { display: block; font-size: 0.85rem; opacity: 0.9; }
.balance-card strong { font-size: 1.4rem; }

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-api-access {
    background: #7c3aed;
    color: #fff;
    border: none;
    font-weight: 600;
}
.btn-api-access:hover {
    background: #6d28d9;
    color: #fff;
}
.api-access-modal .modal-body { overflow-y: auto; max-height: 75vh; }
.api-access-modal .api-grid { margin-bottom: 16px; }

.dashboard-grid { display: grid; gap: 24px; }
.dashboard-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.dashboard-card h2 { font-size: 1.1rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dashboard-card h2 i { color: var(--primary); }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header-row h2 { margin-bottom: 0; }
.card-header-tools {
    flex-wrap: wrap;
    gap: 10px 12px;
}
.card-header-tools h2 { flex: 1 1 auto; min-width: 140px; }
.table-toolbar-search {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 180px;
    max-width: 260px;
    margin-left: auto;
}
.table-toolbar-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.table-pager {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pager-btn {
    min-width: 32px;
    padding: 4px 8px !important;
}
.pager-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.order-history-summary {
    padding: 12px 16px 0;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.pagination-numbers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
    border-top: 1px solid var(--border);
}
.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}
.pagination-num:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pagination-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    cursor: default;
}
.pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    line-height: 38px;
}

/* API Card */
.api-card { margin-bottom: 24px; border: 2px solid rgba(40,167,69,0.2); }
.api-desc { color: var(--text-muted); font-size: 0.9rem; margin: -8px 0 20px; }
.api-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.api-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.copy-field { display: flex; gap: 8px; }
.copy-field input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.85rem;
    background: var(--bg);
}
.api-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.api-docs {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 0.88rem;
}
.api-docs summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.api-docs ol { margin: 12px 0 12px 20px; }
.api-docs code { background: white; padding: 2px 6px; border-radius: 4px; font-size: 0.82rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--bg); font-weight: 600; font-size: 0.85rem; }
.data-table tr.row-inactive { opacity: 0.55; }
.data-table tr.row-inactive td { background: #fafafa; }
.users-table { table-layout: fixed; min-width: 980px; }
.users-table th,
.users-table td { vertical-align: middle; }
.users-table .user-name-cell,
.users-table .user-email-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.users-table .user-name-cell { max-width: 140px; }
.users-table .user-email-cell {
    max-width: 220px;
    font-size: 0.82rem;
    color: #555;
}
.admin-users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.admin-users-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-users-search input[type="search"] {
    width: min(420px, 80vw);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.admin-users-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.table-wrap { max-width: 100%; overflow-x: auto; }
.text-center { text-align: center; }

/* Order history — clickable rows + truncated result */
.admin-order-row { cursor: pointer; transition: background 0.15s; }
.admin-order-row:hover,
.admin-order-row:focus { background: rgba(40, 167, 69, 0.08); outline: none; }
.admin-order-error {
    margin-top: 16px;
    padding: 12px 14px;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius);
    color: #721c24;
}
.admin-order-error pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    padding: 0;
}
.admin-order-modal .modal-dialog {
    max-width: 580px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.admin-order-modal .modal-body,
.admin-order-modal #admin-order-modal-body {
    overflow-x: hidden;
    overflow-y: auto !important;
    display: block !important;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(52vh, 480px);
    -webkit-overflow-scrolling: touch;
}
.admin-order-modal-footer {
    flex-direction: column;
    align-items: stretch;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: min(38vh, 320px);
    -webkit-overflow-scrolling: touch;
}
.admin-order-modal-footer .btn { margin: 0; }
.admin-order-modal .order-detail-pre {
    max-height: none;
}
.admin-order-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.admin-manual-finalize {
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.admin-manual-finalize label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.admin-manual-finalize textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 72px;
}
.admin-manual-finalize-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.admin-manual-finalize-btns .btn-success {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.admin-manual-finalize-btns .btn-success:hover {
    background: var(--primary-dark);
}

.order-history-table .order-history-row { cursor: pointer; transition: background 0.15s; }
.order-history-table .order-history-row:hover,
.order-history-table .order-history-row:focus { background: rgba(40, 167, 69, 0.06); outline: none; }
.order-history-table .col-result-truncate,
.order-history-table .col-ellipsis,
.order-history-table .col-service-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.order-history-table .col-result-truncate small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.order-detail-modal .modal-dialog { max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; }
.order-detail-modal .modal-body { overflow-y: auto; }
.order-detail-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px 16px;
    margin: 0;
    font-size: 0.9rem;
}
.order-detail-grid dt { margin: 0; font-weight: 600; color: var(--text-muted); }
.order-detail-grid dd { margin: 0; word-break: break-word; }
.order-detail-pre {
    margin: 0;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 140px;
    overflow-y: auto;
}
.order-detail-result { max-height: 200px; }
.order-result-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-success { background: rgba(40,167,69,0.15); color: var(--primary); }
.badge-warning { background: rgba(255,152,0,0.15); color: #e65100; }
.badge-danger { background: rgba(220,53,69,0.15); color: #dc3545; }
.badge-info { background: rgba(0,123,255,0.15); color: #007bff; }
.badge-secondary { background: rgba(0,0,0,0.08); color: var(--text-muted); }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-success { background: rgba(40,167,69,0.12); color: var(--primary-dark); border: 1px solid rgba(40,167,69,0.3); }
.alert-error { background: rgba(220,53,69,0.12); color: #dc3545; border: 1px solid rgba(220,53,69,0.3); }

.empty-msg { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 40px; }
.service-grid .service-card.is-filtered-out { display: none !important; }
.service-grid.is-search-empty .services-filter-empty { display: block; }
.service-grid.is-search-empty .services-filter-empty[hidden] { display: block; }

/* Footer */
.site-footer {
    background: #fff;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
}
.site-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}
.footer-inner p { margin-bottom: 4px; }

/* Admin Layout */
.admin-body { background: var(--bg); }
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 240px;
    background: var(--dark);
    color: white;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-brand i { color: var(--primary); }

.sidebar-nav { padding: 12px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(40,167,69,0.15);
    color: var(--primary);
}
.sidebar-nav .sidebar-view-site {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 14px;
    color: rgba(255,255,255,0.85);
}
.sidebar-nav .sidebar-view-site:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.admin-main {
    margin-left: 240px;
    flex: 1;
    padding: 30px;
}

/* Admin white areas: global .btn-outline is white-on-dark (header); fix visibility */
.admin-main .btn-outline,
.admin-modal .btn-outline {
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-weight: 600;
}
.admin-main .btn-outline:hover,
.admin-modal .btn-outline:hover {
    background: #f0fdf4;
    border-color: var(--primary);
    color: var(--primary);
}
.admin-main .btn,
.admin-modal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    vertical-align: middle;
}
.admin-main .btn i,
.admin-modal .btn i {
    color: inherit;
    opacity: 1;
    font-size: 0.95em;
}

.admin-title { font-size: 1.6rem; margin-bottom: 8px; }
.admin-subtitle { color: var(--text-muted); margin-bottom: 24px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 48px; height: 48px;
    background: rgba(40,167,69,0.1);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.stat-icon i { color: var(--primary); font-size: 1.2rem; }
.stat-card h3 { font-size: 1.5rem; }
.stat-card p { color: var(--text-muted); font-size: 0.85rem; }

.admin-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 1rem; }

.admin-form { padding: 20px; }
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.admin-tabs a {
    padding: 8px 16px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
}
.admin-tabs a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.deposit-action-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.invoice-act-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; padding: 0; }
.invoices-table { table-layout: fixed; min-width: 1100px; }
.invoices-table .invoice-email {
    max-width: 180px;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.invoices-table td .deposit-action-form { min-width: 220px; }
.input-sm { padding: 4px 8px; font-size: 0.85rem; max-width: 100px; }
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

.filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-tabs a {
    padding: 6px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.9rem;
}
.filter-tabs a.active { background: var(--primary); color: white; border-color: var(--primary); }
.filter-tabs a .tab-count {
    display: inline-block;
    min-width: 1.25rem;
    padding: 0 6px;
    margin-left: 4px;
    font-size: 0.75rem;
    line-height: 1.35rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
}
.filter-tabs a.active .tab-count { background: rgba(255, 255, 255, 0.25); }
.card-header-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header-tabs h2 { margin: 0; }
.filter-tabs-inline { margin-bottom: 0; }
.card-header-orders {
    gap: 12px 16px;
}
.card-header-orders h2 {
    flex: 0 0 auto;
    width: 100%;
}
@media (min-width: 768px) {
    .card-header-orders h2 { width: auto; flex: 0 0 auto; }
}
.admin-order-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
    min-width: 0;
}
.admin-order-search-form input[type="search"] {
    flex: 1 1 180px;
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.admin-order-search-form .btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.input-sm { padding: 5px 8px; font-size: 0.85rem; width: auto; border: 1px solid var(--border); border-radius: 4px; }
.inline-form { display: flex; align-items: center; gap: 8px; padding: 16px 20px; }
td.actions-cell {
    vertical-align: middle;
    white-space: nowrap;
    min-width: 200px;
}
.actions-cell-toolbar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}
.actions-cell .provider-actions-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0;
    padding: 0;
}
.actions-cell .btn-select-services {
    color: var(--primary);
    border-color: var(--primary);
    background: #fff;
    flex-shrink: 0;
}
.actions-cell .btn-select-services:hover {
    background: #f0fdf4;
}
.actions-cell .btn-provider-refresh { color: #0d6efd; border-color: #93c5fd; }
.actions-cell .btn-provider-refresh:hover { background: #eff6ff; color: #0d6efd; }
.actions-cell .btn-provider-test { color: #7c3aed; border-color: #c4b5fd; }
.actions-cell .btn-provider-test:hover { background: #f5f3ff; color: #6d28d9; }
.actions-cell .btn-provider-toggle { color: #d97706; border-color: #fcd34d; }
.actions-cell .btn-provider-toggle:hover { background: #fffbeb; color: #b45309; }
body.modal-open { overflow: hidden; }

/* Admin expandable services & providers */
.add-service-card { margin-bottom: 24px; border: 2px solid rgba(40,167,69,0.25); }
.add-service-card .card-header h2 { color: var(--primary); font-size: 1.1rem; }
.service-list-card .service-row,
.provider-list-card .provider-row { cursor: pointer; transition: background 0.15s; }
.service-list-card .service-row:hover,
.provider-list-card .provider-row:hover { background: #f8f9fa; }
.service-list-card .service-row.expanded,
.provider-list-card .provider-row.expanded { background: rgba(40,167,69,0.06); }
.service-list-card .service-expand-table { table-layout: fixed; width: 100%; }
.service-list-card .service-expand-table th:nth-child(1),
.service-list-card .service-expand-table td:nth-child(1) { width: 42px; }
.service-list-card .service-expand-table th:nth-child(2),
.service-list-card .service-expand-table td:nth-child(2) { width: 42%; }
.service-list-card .service-expand-table th:nth-child(3),
.service-list-card .service-expand-table td:nth-child(3) { width: 72px; }
.service-list-card .service-expand-table th:nth-child(4),
.service-list-card .service-expand-table td:nth-child(4) { width: 88px; }
.service-list-card .service-expand-table th:nth-child(5),
.service-list-card .service-expand-table td:nth-child(5) { width: 100px; }
.service-list-card .service-expand-table th:nth-child(6),
.service-list-card .service-expand-table td:nth-child(6) { width: 90px; }
.service-list-card .service-expand-table th:nth-child(7),
.service-list-card .service-expand-table td:nth-child(7) { width: 80px; }
.service-click-cell { max-width: 0; overflow: hidden; vertical-align: middle; }
.provider-click-cell { min-width: 220px; }
.service-row-title { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.service-row-title > .service-row-text { min-width: 0; flex: 1; overflow: hidden; }
.service-name-text,
.service-row-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.service-name-text { font-weight: 600; margin-bottom: 2px; }
.service-row-meta { color: var(--text-muted); }
.service-list-card .service-expand-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-list-card .service-expand-table td.service-click-cell { white-space: normal; overflow: visible; }
.service-list-card .service-expand-table td.service-click-cell .service-name-text,
.service-list-card .service-expand-table td.service-click-cell .service-row-meta { white-space: nowrap; overflow: hidden; }
.services-table-scroll { max-height: 65vh; overflow: auto; }
.services-pagination-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.services-pagination-bar .pagination-links { display: flex; align-items: center; gap: 10px; }
.services-pagination-bar .page-num { font-size: 0.88rem; color: var(--text-muted); }
.service-list-card .col-select { width: 42px; text-align: center; vertical-align: middle; }
.service-list-card .col-select input { width: 16px; height: 16px; cursor: pointer; }
.service-list-card .btn-expand { display: none !important; }
.admin-service-thumb,
.service-thumb {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}
.icon-thumb {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40,167,69,0.1);
    border-radius: var(--radius);
    color: var(--primary);
}
.btn-expand {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
}
.service-detail-row { display: none; }
.service-detail-row.open { display: table-row; }
.provider-detail-row { display: none; }
.provider-detail-row.open { display: table-row; }
.service-detail-row td,
.provider-detail-row td {
    padding: 0 !important;
    background: #f8f9fa;
    border-bottom: 2px solid var(--primary);
}
.service-edit-panel { padding: 24px; }
.provider-edit-panel { padding: 24px; }
.provider-edit-panel h3 { margin: 0 0 8px; font-size: 1rem; }

/* Select services modal */
.admin-modal { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; padding: 20px; }
.admin-modal.open { display: flex; }
.admin-modal .modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.admin-modal .modal-dialog {
    position: relative; background: #fff; border-radius: var(--radius);
    width: 100%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.admin-modal .modal-lg { max-width: 860px; }
.admin-modal .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.admin-modal .modal-header h2 { margin: 0; font-size: 1.1rem; }
.admin-modal .modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.admin-modal .modal-body { padding: 16px 20px; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.admin-modal .modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.select-services-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.select-services-toolbar .search-input { flex: 1; min-width: 180px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.select-services-check-all { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap; padding: 6px 10px; border: 1px solid var(--primary); border-radius: var(--radius); background: rgba(13, 148, 136, 0.08); color: var(--primary); }
.select-services-check-all input { width: 16px; height: 16px; cursor: pointer; }
.service-pick-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.service-pick-group-head h4 { margin: 0; font-size: 0.85rem; color: var(--primary); }
.btn-group-select-all { font-size: 0.75rem; padding: 2px 8px; }
.select-services-list { overflow-y: auto; max-height: 50vh; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.service-pick-group h4 { margin: 12px 8px 6px; font-size: 0.85rem; color: var(--primary); text-transform: uppercase; letter-spacing: 0.03em; }
.service-pick-group:first-child h4 { margin-top: 4px; }
.service-pick-item {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px;
    border-radius: 6px; cursor: pointer; border-bottom: 1px solid #f0f0f0;
}
.service-pick-item:hover { background: #f8f9fa; }
.service-pick-item.is-imported { opacity: 0.65; }
.service-pick-item input { margin-top: 4px; flex-shrink: 0; }
.service-pick-item .pick-name {
    flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.35;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.service-pick-group-head h4 {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.service-pick-item .pick-meta { font-size: 0.78rem; color: var(--text-muted); }
.edit-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.edit-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.edit-section.full-width { grid-column: 1 / -1; }
.edit-section h3 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.price-fields { display: grid; gap: 12px; }
.commission-hint { font-size: 0.82rem; color: var(--text-muted); margin-top: 10px; }
.media-picker { display: flex; flex-direction: column; gap: 12px; }
.current-media { text-align: center; }
.preview-image { max-width: 120px; max-height: 120px; border-radius: var(--radius); object-fit: cover; }
.preview-icon {
    width: 80px; height: 80px; margin: 0 auto;
    background: rgba(40,167,69,0.1); border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--primary);
}
.custom-fields-table input,
.custom-fields-table select { width: 100%; padding: 6px 8px; font-size: 0.85rem; }
.field-builder { margin-top: 4px; }
.field-builder-header h3 { margin: 0 0 6px; font-size: 1rem; }
.field-builder .form-hint { margin: 0 0 12px; font-size: 0.85rem; color: var(--text-muted); }
.field-presets {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 14px; padding: 12px; background: rgba(0,0,0,0.03);
    border-radius: var(--radius); border: 1px dashed var(--border);
}
.field-presets .preset-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.btn-preset {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; font-size: 0.78rem; border: 1px solid var(--border);
    background: #fff; border-radius: 20px; cursor: pointer; transition: all 0.15s;
}
.btn-preset:hover { border-color: var(--primary); color: var(--primary); background: rgba(40,167,69,0.06); }
.field-builder .btn-add-field { margin-top: 10px; }
.custom-fields-table-wrap { overflow-x: auto; margin-bottom: 4px; }
.settings-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flags-group label { display: inline-block; margin-right: 14px; font-weight: normal; }
.edit-panel-actions { margin-top: 20px; display: flex; gap: 10px; }
.checkbox-inline { font-size: 0.88rem; display: flex; align-items: center; gap: 6px; }
.text-muted { color: var(--text-muted); }

@media (max-width: 992px) {
    .edit-panel-grid { grid-template-columns: 1fr; }
    .settings-row { grid-template-columns: 1fr; }
    .inventory-layout { grid-template-columns: 1fr; }
}

/* Digital inventory admin */
.inventory-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}
.inventory-list-panel { padding: 0; }
.inventory-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.inventory-list-header h2 { margin: 0; font-size: 0.95rem; }
.inv-count { color: var(--text-muted); font-weight: normal; }
.inventory-inline-form { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.inventory-inline-form form { display: flex; gap: 8px; }
.inventory-inline-form input { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.inventory-name-list { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.inventory-name-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid #f0f0f0;
}
.inventory-name-list li.active { background: rgba(40,167,69,0.08); border-left: 3px solid var(--primary); }
.inv-name-link {
    flex: 1; text-decoration: none; color: var(--text); font-size: 0.88rem; font-weight: 500;
    display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.inv-name-text { font-weight: 600; }
.inv-linked-services {
    font-size: 0.72rem; font-weight: 400; color: var(--primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inv-linked-services.inv-linked-none { color: var(--text-muted); font-style: italic; }
.inv-panel-linked { margin: 0 0 10px; font-size: 0.88rem; color: var(--text); }
.inv-panel-linked.inv-linked-none { color: var(--text-muted); }
.inventory-linked-preview {
    margin-top: 8px; padding: 10px 12px; background: rgba(40, 167, 69, 0.08);
    border: 1px solid rgba(40, 167, 69, 0.25); border-radius: var(--radius);
    font-size: 0.85rem; line-height: 1.4;
}
.inv-connect-line { color: var(--primary); font-size: 0.75rem; }
.provider-linked-services {
    font-size: 0.75rem; color: var(--primary); display: block;
    max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.provider-linked-none { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.provider-linked-preview {
    margin-top: 8px; padding: 10px 12px; background: rgba(0, 123, 255, 0.06);
    border: 1px solid rgba(0, 123, 255, 0.2); border-radius: var(--radius);
    font-size: 0.85rem; line-height: 1.4;
}
.provider-services-linked-list {
    list-style: none; margin: 0 0 16px; padding: 0; max-height: 200px; overflow-y: auto;
}
.provider-services-linked-list li {
    padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.88rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.provider-services-linked-list a { font-weight: 500; }
.provider-linked-none-block { margin-bottom: 16px; }
.inv-row-actions { display: flex; gap: 4px; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--primary); padding: 4px; }
.btn-danger-icon { color: #dc3545; }
.inventory-keys-panel { padding: 0; }
.keys-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.keys-panel-header h2 { margin: 0 0 8px; font-size: 1.1rem; }
.keys-stats { display: flex; gap: 16px; font-size: 0.85rem; }
.stat-available { color: var(--primary); font-weight: 600; }
.stat-sold { color: #e67e22; font-weight: 600; }
.keys-toolbar { padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); }
.filter-pills { display: flex; gap: 6px; }
.filter-pills .pill {
    padding: 6px 14px; border-radius: 20px; text-decoration: none;
    font-size: 0.82rem; background: #eee; color: #333;
}
.filter-pills .pill.active { background: #333; color: #fff; }
.filter-pills .pill-green.active { background: var(--primary); }
.filter-pills .pill-orange.active { background: #e67e22; }
.keys-search-form { flex: 1; min-width: 200px; position: relative; }
.keys-search-form i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.keys-search-form input {
    width: 100%; padding: 8px 12px 8px 36px;
    border: 1px solid var(--border); border-radius: var(--radius);
}
.add-key-row { padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.add-key-form { display: flex; flex: 1; gap: 8px; min-width: 260px; }
.add-key-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.btn-teal { background: #17a2b8; color: #fff; border: none; }
.btn-teal:hover { background: #138496; color: #fff; }
.bulk-add-panel { padding: 0 20px 16px; }
.bulk-add-panel textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); font-family: monospace; font-size: 0.85rem; }
.inventory-keys-table .code-cell code { font-size: 0.8rem; word-break: break-all; white-space: pre-wrap; }
.text-success { color: var(--primary) !important; }
.text-warning { color: #e67e22 !important; }
.btn-warning { background: #e67e22; color: #fff; border: none; }
.btn-warning:hover { background: #d35400; color: #fff; }

/* Responsive */
@media (max-width: 992px) {
    .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .features-grid { grid-template-columns: 1fr; }
    .admin-grid-2 { grid-template-columns: 1fr; }
    .admin-users-toolbar { align-items: flex-start; flex-direction: column; }
    .users-table .user-email-cell { max-width: 170px; }
}

@media (max-width: 991px) {
    .site-header {
        z-index: 1000;
        position: sticky;
        top: 0;
    }

    .header-bar-inner {
        height: 56px;
        gap: 8px;
        position: relative;
        z-index: 1002;
    }

    .logo {
        min-width: 0;
        flex: 1 1 auto;
    }

    .logo-text {
        font-size: 1.05rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logo i {
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .nav-toggle,
    .header-balance-mobile {
        display: inline-flex;
    }

    .nav-toggle {
        position: relative;
        z-index: 1003;
    }

    .header-balance-mobile {
        font-size: 0.8rem;
        max-width: 42%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-menu {
        display: flex;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 56px 16px 24px;
        padding-top: calc(56px + 12px);
        overflow-y: auto;
        z-index: 1001;
        color: #fff;
        box-shadow: -4px 0 32px rgba(0, 0, 0, 0.35);
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.25s ease, visibility 0.25s, opacity 0.25s;
    }

    body.nav-open .header-menu {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    body.nav-open .header-menu[aria-hidden="false"] {
        visibility: visible;
    }

    body.nav-open {
        overflow: hidden;
        touch-action: none;
    }

    .header-menu > .mobile-nav-head,
    .header-menu > .main-nav,
    .header-menu > .header-actions {
        position: relative;
        z-index: 1;
    }

    .mobile-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .mobile-nav-title {
        color: #fff;
        font-weight: 600;
        font-size: 1rem;
    }

    .mobile-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }

    body.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .main-nav {
        flex: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 12px;
    }

    .main-nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 12px;
        font-size: 1rem;
        border-radius: 8px;
        color: #fff;
        text-decoration: none;
        touch-action: manipulation;
    }

    .main-nav a:hover,
    .main-nav a.active {
        background: rgba(40, 167, 69, 0.2);
        color: #fff;
    }

    .main-nav a i {
        width: 20px;
        text-align: center;
        margin-right: 0;
        font-size: 1rem;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .header-actions .balance-badge {
        display: none;
    }

    .header-actions .btn,
    .header-actions .currency-picker-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .header-actions .currency-picker {
        width: 100%;
    }

    .header-actions .currency-picker-btn {
        display: flex;
    }

    .header-actions .currency-picker-menu {
        left: 0;
        right: 0;
        min-width: 0;
    }

    .header-actions .user-type-badge {
        text-align: center;
        display: block;
        color: var(--primary);
    }

    .header-actions .btn-ghost {
        border: 1px solid rgba(255, 255, 255, 0.25);
        color: #fff;
        padding: 10px;
    }

    .header-actions .currency-picker-btn {
        border: 1px solid rgba(255, 255, 255, 0.25);
        background: rgba(0, 0, 0, 0.25);
        color: #fff;
    }
}

@media (min-width: 992px) {
    .mobile-nav-head {
        display: none;
    }

    .site-header-bar {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .header-bar-inner {
        height: 60px;
    }

    .header-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: static !important;
        transform: none !important;
        flex: 1 1 auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 0;
        background: transparent !important;
        background-image: none !important;
        overflow: visible;
        min-width: 0;
        box-shadow: none !important;
    }

    .header-menu.hero-surface::before,
    .header-menu.hero-surface::after {
        display: none !important;
    }

    .nav-toggle,
    .header-balance-mobile {
        display: none !important;
    }

    .nav-backdrop {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .service-grid { grid-template-columns: minmax(0, 1fr); }
    .api-grid { grid-template-columns: 1fr; }
    .admin-sidebar { width: 100%; height: auto; position: relative; }
    .admin-main { margin-left: 0; }
    .admin-layout { flex-direction: column; }
}
