.admin-main {
    min-height: calc(100vh - 80px);
    padding: 100px 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 60vh;
    text-align: center;
    color: var(--muted);
}

.admin-denied i {
    font-size: 48px;
    color: var(--primary);
}

.admin-denied h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.admin-login-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
    transition: transform 0.1s ease;
}

.admin-login-btn:hover { transform: translateY(-2px); }

.admin-header {
    margin-bottom: 24px;
}

.admin-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-title i { color: var(--primary); }

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.admin-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

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

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-search {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
}

.admin-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.admin-count {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 700;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

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

.admin-table tr:hover td { background: var(--surface-2); }

.admin-delete-btn {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-delete-btn:hover { background: #fee2e2; border-color: #f87171; }

.admin-add-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

.admin-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.admin-form h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.admin-field label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.admin-field input,
.admin-field textarea,
.admin-field select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.admin-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.22);
    margin-top: 8px;
}

.admin-submit:hover { transform: translateY(-2px); }

.admin-preview {
    position: sticky;
    top: 100px;
}

.admin-preview h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.preview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}

.preview-image {
    aspect-ratio: 320 / 200;
    background: var(--surface-2);
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    color: var(--primary-700);
    background: #e0f2fe;
    width: fit-content;
}

.preview-price {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.preview-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    line-height: 1.3;
}

.admin-orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.admin-order-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-wrap: wrap;
}

.admin-order-header:hover { background: var(--surface-2); }

.order-id {
    font-weight: 800;
    color: var(--primary);
    font-size: 15px;
    min-width: 80px;
}

.order-date {
    color: var(--muted);
    font-size: 13px;
}

.order-email {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.order-total {
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
}

.order-chevron {
    color: var(--muted);
    transition: transform 0.2s ease;
}

.admin-order-card.open .order-chevron {
    transform: rotate(180deg);
}

.admin-order-details {
    display: none;
    padding: 0 20px 16px;
    border-top: 1px solid var(--border);
}

.admin-order-card.open .admin-order-details {
    display: block;
    padding-top: 12px;
}

.order-items-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.order-items-table th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.order-items-table td {
    padding: 6px 8px;
    color: var(--text);
}

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

.admin-empty-state i {
    font-size: 40px;
    color: var(--border);
    margin-bottom: 12px;
    display: block;
}

.admin-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.35);
}

.admin-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Dark theme */
body.theme-dark .admin-table-wrap,
body.theme-dark .admin-form,
body.theme-dark .admin-order-card,
body.theme-dark .preview-card {
    background: #111827;
    border-color: #1f2937;
}

body.theme-dark .admin-table th { background: #0f172a; color: #9ca3af; border-color: #1f2937; }
body.theme-dark .admin-table td { border-color: #1f2937; color: #e5e7eb; }
body.theme-dark .admin-table tr:hover td { background: #1f2937; }
body.theme-dark .admin-search { background: #111827; border-color: #1f2937; color: #e5e7eb; }
body.theme-dark .admin-field input,
body.theme-dark .admin-field textarea,
body.theme-dark .admin-field select { background: #0f172a; border-color: #1f2937; color: #e5e7eb; }
body.theme-dark .admin-delete-btn { background: rgba(220, 38, 38, 0.15); color: #f87171; border-color: rgba(220, 38, 38, 0.3); }
body.theme-dark .admin-order-header:hover { background: #1f2937; }
body.theme-dark .admin-order-details { border-color: #1f2937; }
body.theme-dark .preview-badge { background: rgba(14, 165, 233, 0.2); }

@media (max-width: 900px) {
    .admin-add-layout { grid-template-columns: 1fr; }
    .admin-preview { position: static; }
}

@media (max-width: 640px) {
    .admin-main { padding: 90px 12px 40px; }
    .admin-tabs { overflow-x: auto; gap: 4px; }
    .admin-tab { padding: 10px 14px; font-size: 13px; }
    .admin-row { grid-template-columns: 1fr; }
    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 10px 10px; }
    .admin-order-header { flex-direction: column; align-items: flex-start; }
}
