/* ============================================
   TAD Admin Panel | admin.css
   ============================================ */
:root {
    --a-bg: #08080e;
    --a-bg-2: #0f0f18;
    --a-surface: #13131e;
    --a-surface-2: #1a1a28;
    --a-border: rgba(255, 255, 255, 0.07);
    --a-border-2: rgba(255, 255, 255, 0.13);

    --a-primary: #e8600a;
    --a-primary-h: #ff7520;
    --a-accent: #6366f1;
    --a-accent-h: #818cf8;
    --a-green: #22c55e;
    --a-red: #ef4444;
    --a-gold: #f59e0b;

    --a-text: #f1f1f5;
    --a-text-2: #9898b5;
    --a-text-3: #5a5a78;

    --sidebar-w: 240px;
    --topbar-h: 64px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
    --t: 0.25s cubic-bezier(.4, 0, .2, 1);
    --font: 'Outfit', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--a-bg);
    color: var(--a-text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: var(--font);
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: var(--font);
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--a-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--a-primary);
    border-radius: 2px;
}

/* ---- LOGIN SCREEN ---- */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 30% 40%, rgba(99, 102, 241, .12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(232, 96, 10, .1) 0%, transparent 60%),
        var(--a-bg);
}

.login-card {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: 24px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.logo-tad-admin {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: .1em;
    background: linear-gradient(135deg, var(--a-primary), var(--a-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-badge,
.sidebar-badge {
    padding: 3px 10px;
    background: rgba(99, 102, 241, .18);
    border: 1px solid rgba(99, 102, 241, .3);
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--a-accent);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-sub {
    color: var(--a-text-2);
    font-size: .9rem;
    margin-bottom: 28px;
}

.err-msg {
    color: var(--a-red);
    font-size: .85rem;
    margin-bottom: 12px;
    min-height: 18px;
}

.ok-msg {
    color: var(--a-green);
    font-size: .9rem;
    margin-bottom: 12px;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--a-text-3);
    font-size: .88rem;
    transition: var(--t);
}

.back-link:hover {
    color: var(--a-primary);
}

/* ---- FORM ELEMENTS ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .83rem;
    font-weight: 600;
    color: var(--a-text-2);
    margin-bottom: 7px;
}

.form-group input,
.form-group textarea,
.admin-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--a-bg-2);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-md);
    color: var(--a-text);
    font-size: .92rem;
    outline: none;
    transition: var(--t);
}

.form-group input:focus,
.form-group textarea:focus,
.admin-input:focus {
    border-color: var(--a-primary);
    box-shadow: 0 0 0 3px rgba(232, 96, 10, .15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--a-text-3);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media(min-width:720px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.pw-wrap {
    position: relative;
}

.pw-wrap input {
    padding-right: 42px;
}

.pw-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--a-text-3);
    font-size: 15px;
    transition: var(--t);
}

.pw-eye:hover {
    color: var(--a-text);
}

.select-wrap {
    position: relative;
}

.admin-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--a-bg-2);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-md);
    color: var(--a-text);
    font-size: .92rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239898b5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.admin-select:focus {
    border-color: var(--a-primary);
}

.admin-select-sm {
    background: var(--a-surface-2);
    border: 1px solid var(--a-border);
    border-radius: 6px;
    color: var(--a-text);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239898b5' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.admin-select-sm:focus { border-color: var(--a-primary); }

.admin-select-sm.status-new { color: var(--a-gold); border-color: rgba(245, 158, 11, 0.3); }
.admin-select-sm.status-processing { color: var(--a-accent); border-color: rgba(99, 102, 241, 0.3); }
.admin-select-sm.status-completed { color: var(--a-green); border-color: rgba(34, 197, 94, 0.3); }
.admin-select-sm.status-cancelled { color: var(--a-red); border-color: rgba(239, 68, 68, 0.3); }
.admin-select-sm.status-cart { color: var(--a-text-2); opacity: 0.7; }

/* ---- BUTTONS ---- */
.btn-admin-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--a-primary), #c94f05);
    color: #fff;
    font-weight: 700;
    font-size: .92rem;
    border-radius: 100px;
    transition: var(--t);
    box-shadow: 0 4px 18px rgba(232, 96, 10, .35);
    white-space: nowrap;
}

.btn-admin-primary:hover {
    background: linear-gradient(135deg, var(--a-primary-h), var(--a-primary));
    box-shadow: 0 6px 28px rgba(232, 96, 10, .5);
    transform: translateY(-1px);
}

.btn-admin-primary.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-admin-primary.btn-sm {
    padding: 8px 18px;
    font-size: .84rem;
}

.btn-admin-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border: 1.5px solid var(--a-border-2);
    border-radius: 100px;
    color: var(--a-text);
    font-weight: 600;
    font-size: .88rem;
    background: rgba(255, 255, 255, .04);
    transition: var(--t);
    white-space: nowrap;
}

.btn-admin-outline:hover {
    border-color: var(--a-primary);
    color: var(--a-primary);
}

.btn-admin-outline.btn-sm {
    padding: 7px 16px;
    font-size: .82rem;
}

.btn-admin-ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--a-text-2);
    font-size: .85rem;
    background: transparent;
    transition: var(--t);
}

.btn-admin-ghost:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--a-text);
}

.btn-admin-ghost.btn-sm {
    padding: 5px 12px;
    font-size: .8rem;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: rgba(239, 68, 68, .15);
    border: 1px solid rgba(239, 68, 68, .3);
    border-radius: 100px;
    color: var(--a-red);
    font-weight: 700;
    font-size: .88rem;
    transition: var(--t);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, .25);
    transform: translateY(-1px);
}

.btn-danger.btn-sm {
    padding: 7px 16px;
    font-size: .82rem;
}

/* ---- ADMIN APP LAYOUT ---- */
.admin-app {
    display: flex;
    min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--a-surface);
    border-right: 1px solid var(--a-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: transform var(--t);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

@media(max-width:900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--a-border);
}

.sidebar-header .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 28px;
    padding: 4px;
    display: none;
}

.sidebar-toggle span {
    height: 2px;
    background: var(--a-text-2);
    border-radius: 2px;
    transition: var(--t);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: var(--a-text-2);
    font-weight: 600;
    font-size: .9rem;
    transition: var(--t);
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .05);
    color: var(--a-text);
}

.nav-item.active {
    background: rgba(232, 96, 10, .14);
    color: var(--a-primary);
    border: 1px solid rgba(232, 96, 10, .2);
}

.nav-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--a-border);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--a-primary), var(--a-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .9rem;
    color: #fff;
    flex-shrink: 0;
}

.admin-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-info span {
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-info small {
    font-size: .72rem;
    color: var(--a-text-3);
}

.btn-logout-sidebar {
    width: 100%;
    padding: 9px;
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .2);
    border-radius: var(--radius-sm);
    color: var(--a-red);
    font-weight: 600;
    font-size: .85rem;
    transition: var(--t);
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, .2);
}

/* ---- MAIN CONTENT ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: margin var(--t);
    background: var(--a-bg);
}

@media(max-width:900px) {
    .main-content {
        margin-left: 0;
    }
}

/* ---- TOPBAR ---- */
.topbar {
    height: var(--topbar-h);
    background: rgba(8, 8, 14, .85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--a-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.hamburger-admin {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 7px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-sm);
}

.hamburger-admin span {
    height: 2px;
    background: var(--a-text);
    border-radius: 2px;
}

@media(max-width:900px) {
    .hamburger-admin {
        display: flex;
    }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--a-primary), var(--a-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .82rem;
    color: #fff;
}

/* ---- PAGES ---- */
.page {
    display: none;
    padding: 28px 28px 60px;
    animation: fadeSlideIn .35s ease;
}

.page.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- PANEL HEADER ---- */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 800;
}

.panel-header h4 {
    font-size: .92rem;
    font-weight: 700;
    color: var(--a-text-2);
}

/* ---- DASHBOARD ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--t);
}

.stat-card:hover {
    border-color: var(--a-border-2);
    transform: translateY(-2px);
}

.stat-card-accent {
    border-color: rgba(232, 96, 10, .2);
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--a-primary);
    line-height: 1;
}

.stat-label {
    font-size: .78rem;
    color: var(--a-text-2);
    margin-top: 3px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width:900px) {
    .dashboard-grid {
        grid-template-columns: 1.6fr 1fr;
    }
}

.dash-panel {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--a-bg-2);
    border-radius: var(--radius-sm);
    font-size: .86rem;
}

.recent-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--a-bg-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--a-border);
    transition: var(--t);
}

.recent-product-item:hover {
    background: var(--a-surface-2);
    border-color: var(--a-border-2);
}

.recent-product-item img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    background: var(--a-bg);
}

.rpi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rpi-info strong {
    font-size: 0.85rem;
    font-weight: 700;
}

.rpi-info small {
    font-size: 0.75rem;
    color: var(--a-text-3);
}

.recent-item-cat {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--a-primary);
    background: rgba(232, 96, 10, .1);
    padding: 3px 9px;
    border-radius: 100px;
}

.ai-status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .88rem;
    color: var(--a-text-2);
}

.ai-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #444;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .4);
}

.ai-status-dot.on {
    background: var(--a-green);
    box-shadow: 0 0 6px var(--a-green);
}

.ai-status-dot.off {
    background: var(--a-red);
}

.ai-key-hint {
    margin-left: auto;
    font-size: .75rem;
    color: var(--a-text-3);
}

.ai-tip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    background: rgba(99, 102, 241, .08);
    border: 1px solid rgba(99, 102, 241, .15);
    border-radius: var(--radius-md);
    font-size: .83rem;
    color: var(--a-text-2);
    line-height: 1.5;
}

/* ---- ADD PRODUCT PAGE ---- */
.add-product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media(min-width:1000px) {
    .add-product-layout {
        grid-template-columns: 380px 1fr;
    }
}

.product-image-panel,
.product-form-panel {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--a-border-2);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--t);
    margin-bottom: 18px;
    background: var(--a-bg-2);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--a-primary);
    background: rgba(232, 96, 10, .05);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.upload-zone p {
    font-size: .9rem;
    color: var(--a-text-2);
    margin-bottom: 4px;
}

.upload-link {
    color: var(--a-primary);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.upload-hint {
    font-size: .78rem;
    color: var(--a-text-3);
}

/* Image Previews */
.preview-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.preview-tab {
    padding: 7px 16px;
    border: 1.5px solid var(--a-border);
    border-radius: 100px;
    color: var(--a-text-2);
    font-size: .82rem;
    font-weight: 600;
    transition: var(--t);
}

.preview-tab:hover {
    border-color: var(--a-border-2);
    color: var(--a-text);
}

.preview-tab.active {
    border-color: var(--a-primary);
    color: var(--a-primary);
    background: rgba(232, 96, 10, .1);
}

.preview-box {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--a-bg-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--a-border);
    position: relative;
    margin-bottom: 16px;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    background: repeating-conic-gradient(#1a1a28 0% 25%, #111118 0% 50%) 0 0/30px 30px;
}

.preview-img.active-preview {
    display: block;
}

.preview-render {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-render.active-preview {
    display: flex;
}

.preview-render img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-render-placeholder {
    text-align: center;
    color: var(--a-text-3);
    font-size: .88rem;
}

.preview-render-placeholder div {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* AI Action Buttons */
.image-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-ai {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 16px;
    background: var(--a-bg-2);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-md);
    text-align: left;
    transition: var(--t);
    color: var(--a-text);
}

.btn-ai:hover {
    border-color: var(--a-primary);
    background: rgba(232, 96, 10, .06);
}

.btn-ai:disabled {
    opacity: .5;
    pointer-events: none;
}

.btn-ai-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.btn-ai-text {
    flex: 1;
}

.btn-ai-title {
    display: block;
    font-weight: 700;
    font-size: .9rem;
}

.btn-ai-sub {
    display: block;
    font-size: .75rem;
    color: var(--a-text-3);
    margin-top: 2px;
}

.btn-ai-spinner {
    font-size: 1.1rem;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.render-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 4px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--a-text-2);
    cursor: pointer;
}

.radio-label input[type=radio] {
    accent-color: var(--a-primary);
}

/* AI Generate button */
.btn-ai-generate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, .2), rgba(232, 96, 10, .15));
    border: 1.5px solid rgba(99, 102, 241, .3);
    border-radius: 100px;
    color: var(--a-accent-h);
    font-weight: 700;
    font-size: .85rem;
    transition: var(--t);
}

.btn-ai-generate:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, .35), rgba(232, 96, 10, .25));
    border-color: rgba(99, 102, 241, .5);
    transform: translateY(-1px);
}

.btn-ai-generate:disabled {
    opacity: .5;
    pointer-events: none;
}

.ai-banner {
    padding: 12px 16px;
    background: rgba(34, 197, 94, .1);
    border: 1px solid rgba(34, 197, 94, .25);
    border-radius: var(--radius-md);
    font-size: .88rem;
    color: var(--a-green);
    margin-bottom: 16px;
}

/* Materials */
.materials-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    margin-bottom: 18px;
}

@media(min-width:600px) {
    .materials-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.material-card {
    background: var(--a-bg-2);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: var(--t);
}

.material-card[data-mat="vinyl"].active-mat {
    border-color: rgba(99, 102, 241, .35);
}

.material-card[data-mat="silicone"].active-mat {
    border-color: rgba(34, 197, 94, .3);
}

.material-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.material-icon {
    font-size: 1.5rem;
}

.material-name {
    font-weight: 700;
    font-size: .95rem;
    flex: 1;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #2a2a40;
    border-radius: 22px;
    transition: var(--t);
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #666;
    bottom: 3px;
    left: 3px;
    transition: var(--t);
}

.toggle-switch input:checked+.toggle-slider {
    background: rgba(232, 96, 10, .3);
}

.toggle-switch input:checked+.toggle-slider::before {
    background: var(--a-primary);
    transform: translateX(18px);
}

.material-prices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-row label {
    font-size: .8rem;
    color: var(--a-text-2);
    white-space: nowrap;
    width: 70px;
    flex-shrink: 0;
}

.price-row input {
    flex: 1;
    padding: 9px 12px;
    background: var(--a-surface);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-sm);
    color: var(--a-text);
    font-size: .9rem;
    outline: none;
    transition: var(--t);
}

.price-row input:focus {
    border-color: var(--a-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---- PRODUCTS LIST PAGE ---- */
.products-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    background: var(--a-surface);
    border: 1.5px solid var(--a-border);
    border-radius: 100px;
    color: var(--a-text);
    font-size: .9rem;
    outline: none;
    transition: var(--t);
}

.admin-search:focus {
    border-color: var(--a-primary);
}

.filter-select {
    width: 200px;
}

.admin-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.admin-product-card {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--t);
}

.admin-product-card:hover {
    border-color: var(--a-border-2);
    transform: translateY(-2px);
}

.admin-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--a-bg-2);
}

.admin-card-body {
    padding: 14px;
}

.admin-card-cat {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--a-primary);
    margin-bottom: 4px;
}

.admin-card-name {
    font-size: .92rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.admin-card-price {
    font-size: .88rem;
    color: var(--a-text-2);
    margin-bottom: 10px;
}

.admin-card-price strong {
    color: var(--a-primary);
}

.admin-card-actions {
    display: flex;
    gap: 8px;
}

.btn-card-delete {
    padding: 6px 12px;
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .2);
    border-radius: 100px;
    color: var(--a-red);
    font-size: .78rem;
    font-weight: 600;
    transition: var(--t);
}

.btn-card-delete:hover {
    background: rgba(239, 68, 68, .2);
}

.custom-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 100px;
    background: rgba(232, 96, 10, .15);
    color: var(--a-primary);
}

.custom-badge.hot {
    background: rgba(245, 158, 11, .15);
    color: var(--a-gold);
}

/* ---- PRICES PAGE ---- */
.prices-intro {
    text-align: center;
    padding: 10px 0 36px;
}

.prices-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.prices-intro h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.prices-intro p {
    color: var(--a-text-2);
    font-size: .9rem;
}

.materials-full-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

@media(min-width:900px) {
    .materials-full-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.material-full-card {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.material-full-header {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}

.mat-emoji {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.material-full-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.material-full-header p {
    font-size: .85rem;
    color: var(--a-text-2);
    line-height: 1.5;
}

.price-matrix {
    margin-bottom: 20px;
}

.price-matrix-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 8px 12px;
    background: var(--a-bg-2);
    border-radius: var(--radius-sm);
    font-size: .76rem;
    font-weight: 700;
    color: var(--a-text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
}

.price-matrix-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.price-matrix-row input {
    padding: 8px 10px;
    background: var(--a-bg-2);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-sm);
    color: var(--a-text);
    font-size: .88rem;
    outline: none;
    transition: var(--t);
    width: 100%;
}

.price-matrix-row input:focus {
    border-color: var(--a-primary);
}

.btn-del-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .2);
    border-radius: 50%;
    color: var(--a-red);
    font-size: 14px;
}

.btn-del-row:hover {
    background: rgba(239, 68, 68, .2);
}

.btn-add-size {
    width: 100%;
    padding: 10px;
    border: 1.5px dashed var(--a-border-2);
    border-radius: var(--radius-sm);
    color: var(--a-text-3);
    font-size: .86rem;
    font-weight: 600;
    text-align: center;
    transition: var(--t);
    margin-top: 4px;
}

.btn-add-size:hover {
    border-color: var(--a-primary);
    color: var(--a-primary);
}

.material-props {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

/* ---- SETTINGS PAGE ---- */
.settings-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media(min-width:720px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.settings-card {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    padding: 26px;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.settings-icon {
    font-size: 1.6rem;
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 800;
}

.get-key-link {
    color: var(--a-accent-h);
    font-size: .78rem;
    font-weight: 600;
    margin-left: auto;
    transition: var(--t);
}

.get-key-link:hover {
    text-decoration: underline;
}

.api-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: .8rem;
    color: var(--a-text-2);
}

.api-test-text {
    flex: 1;
}

.btn-test {
    padding: 4px 12px;
    background: rgba(99, 102, 241, .15);
    border: 1px solid rgba(99, 102, 241, .2);
    border-radius: 100px;
    color: var(--a-accent-h);
    font-size: .76rem;
    font-weight: 600;
    transition: var(--t);
}

.btn-test:hover {
    background: rgba(99, 102, 241, .25);
}

.sys-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.sys-info-row {
    display: flex;
    justify-content: space-between;
    font-size: .88rem;
    padding: 9px 12px;
    background: var(--a-bg-2);
    border-radius: var(--radius-sm);
}

.sys-info-row span:last-child {
    color: var(--a-primary);
    font-weight: 700;
}

/* ---- TOAST ---- */
.admin-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    padding: 13px 20px;
    background: var(--a-surface-2);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-md);
    color: var(--a-text);
    font-size: .9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.97);
    transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
    max-width: 320px;
}

.admin-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.admin-toast.ok {
    border-color: var(--a-green);
}

.admin-toast.err {
    border-color: var(--a-red);
}

.admin-toast.info {
    border-color: var(--a-accent);
}

/* ---- CONFIRM DIALOG ---- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-box {
    background: var(--a-surface-2);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}

.confirm-box p {
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Responsive overlay for sidebar on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.show {
    display: block;
}

/* ---- PRODUCT CARDS (ADMIN LIST) ---- */
.admin-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.admin-product-card {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--t);
}

.admin-product-card:hover {
    border-color: var(--a-border-2);
    transform: translateY(-2px);
}

.admin-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--a-bg-2);
    display: block;
}

.admin-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-card-cat {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--a-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-card-name {
    font-weight: 700;
    font-size: .9rem;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
}

.admin-card-price {
    font-size: .85rem;
    color: var(--a-text-2);
}

.admin-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Edit button */
.btn-card-edit {
    flex: 1;
    padding: 7px 10px;
    background: rgba(99, 102, 241, .12);
    border: 1px solid rgba(99, 102, 241, .25);
    border-radius: var(--radius-sm);
    color: var(--a-accent-h);
    font-size: .78rem;
    font-weight: 700;
    transition: var(--t);
    white-space: nowrap;
}

.btn-card-edit:hover {
    background: rgba(99, 102, 241, .25);
    border-color: var(--a-accent);
    transform: translateY(-1px);
}

/* Delete button */
.btn-card-delete {
    flex: 1;
    padding: 7px 10px;
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .2);
    border-radius: var(--radius-sm);
    color: var(--a-red);
    font-size: .78rem;
    font-weight: 700;
    transition: var(--t);
    white-space: nowrap;
}

.btn-card-delete:hover {
    background: rgba(239, 68, 68, .22);
    transform: translateY(-1px);
}

/* ---- EDIT MODE BANNER ---- */
.edit-mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, .1);
    border: 1.5px solid rgba(99, 102, 241, .3);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: .88rem;
    animation: fadeSlideIn .3s ease;
}

.edit-mode-banner b {
    color: var(--a-accent-h);
}

.edit-banner-hint {
    font-size: .78rem;
    color: var(--a-text-3);
    white-space: nowrap;
}

/* Cancel Edit ghost btn */
#btnCancelEdit {
    background: rgba(99, 102, 241, .08);
    border: 1.5px solid rgba(99, 102, 241, .3);
    color: var(--a-accent-h);
    padding: 9px 18px;
    border-radius: 100px;
    font-weight: 700;
    font-size: .88rem;
    transition: var(--t);
    white-space: nowrap;
}

#btnCancelEdit:hover {
    background: rgba(99, 102, 241, .18);
}

/* Products page filter */
.products-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    background: var(--a-bg-2);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-md);
    color: var(--a-text);
    font-size: .9rem;
    outline: none;
    transition: var(--t);
}

.admin-search:focus {
    border-color: var(--a-primary);
}

.filter-select {
    min-width: 160px;
}

/* ---- ORDERS TABLE STYLES ---- */
.admin-table-card {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: .88rem;
}

.admin-table th {
    background: var(--a-bg-2);
    padding: 14px 18px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--a-text-3);
    border-bottom: 1px solid var(--a-border);
}

.admin-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--a-border);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Order Thumbnails */
.order-thumb-container {
    position: relative;
    width: 54px;
    height: 54px;
}

.order-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--a-bg-2);
    border: 1px solid var(--a-border-2);
    cursor: pointer;
    transition: var(--t);
    display: block;
}

.order-count-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--a-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 100px;
    border: 2px solid var(--a-surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.order-thumb:hover {
    transform: scale(1.1);
    border-color: var(--a-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.recent-orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px;
}

.recent-order-item {
    display: grid;
    grid-template-columns: 50px 1fr 60px 80px 100px;
    align-items: center;
    padding: 12px 16px;
    background: var(--a-bg-2);
    border: 1px solid var(--a-border-2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--t);
    font-size: 0.88rem;
}

.recent-order-item:hover {
    background: var(--a-surface);
    border-color: var(--a-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ro-date {
    color: var(--a-text-3);
    font-size: 0.75rem;
}

.ro-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.ro-count {
    color: var(--a-text-3);
    font-size: 0.8rem;
}

.ro-price {
    font-weight: 700;
    color: var(--a-primary);
}

.ro-status {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    text-align: right;
}

.recent-order-item .status-new {
    color: var(--a-accent);
}

.recent-order-item .status-processing {
    color: #facc15;
}

.recent-order-item .status-completed {
    color: #4ade80;
}

.order-thumb-empty {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--a-bg-2);
    border-radius: var(--radius-sm);
    color: var(--a-text-3);
    border: 1px dashed var(--a-border-2);
    font-size: 1.2rem;
}

.order-badge-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: .75rem;
    font-weight: 700;
}

.status-new {
    background: rgba(232, 96, 10, 0.15);
    color: var(--a-primary);
}

.status-processing {
    background: rgba(99, 102, 241, 0.15);
    color: var(--a-accent-h);
}

.status-completed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--a-green);
}

.order-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-action-main,
.btn-action-doc,
.btn-action-danger {
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--t);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-action-main {
    background: var(--a-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-action-main:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-action-doc {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.2);
}

.btn-action-doc:hover {
    background: #a855f7;
    color: #fff;
    transform: translateY(-2px);
}

.btn-action-danger {
    width: 32px;
    padding: 0;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-action-danger:hover {
    background: #ef4444;
    color: #fff;
    transform: translateY(-2px);
}


/* Widen orders page */
#page-orders {
    max-width: 100% !important;
}

/* ---- MULTI-ENTRY FIELDS (Sizes/Colors) ---- */
.multi-entry-wrap {
    background: var(--a-bg-2);
    border: 1.5px solid var(--a-border);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    align-items: center;
}

.entry-tag {
    background: var(--a-surface-2);
    border: 1px solid var(--a-border-2);
    border-radius: 6px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--a-text);
}

.entry-tag-remove {
    cursor: pointer;
    color: var(--a-text-3);
    font-size: 14px;
    line-height: 1;
}

.entry-tag-remove:hover {
    color: var(--a-red);
}

.multi-entry-input {
    border: none !important;
    background: none !important;
    outline: none !important;
    color: var(--a-text) !important;
    font-size: 0.9rem !important;
    padding: 4px !important;
    flex: 1 !important;
    min-width: 100px !important;
    margin: 0 !important;
    box-shadow: none !important;
}