/* css/admin.css — FULLY MOBILE OPTIMIZED */
/* ============================================
   KJ'S FASHION — ADMIN DASHBOARD STYLES
   Mobile-First, Touch-Optimized Design
   ============================================ */

/* ============================================
   CSS VARIABLES & BASE
   ============================================ */
:root {
    --touch-target: 48px;
    --sidebar-width: 260px;
    --header-height: 56px;
}

.admin-body {
    background: var(--darker-bg);
    min-height: 100dvh;
    -webkit-tap-highlight-color: rgba(30, 94, 255, 0.1);
    touch-action: manipulation;
}

/* ============================================
   LOGIN OVERLAY
   ============================================ */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 1rem;
    overflow-y: auto;
}

.admin-login-overlay.hidden {
    display: none;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    text-align: center;
    margin: auto;
}

.login-brand {
    margin-bottom: 1.5rem;
}

.login-brand .logo-text {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
}

.login-brand p {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--soft-silver);
    opacity: 0.5;
    margin-top: 0.25rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-group label {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.login-form input {
    width: 100%;
    min-height: var(--touch-target);
    padding: 0.875rem 1rem;
    font-size: 16px; /* Prevent iOS zoom */
    background: rgba(7, 15, 30, 0.8);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--champagne);
    outline: none;
    transition: var(--transition-smooth);
}

.login-form input:focus {
    border-color: var(--luxury-blue);
    box-shadow: 0 0 0 3px rgba(30, 94, 255, 0.15);
}

.login-form input::placeholder {
    color: var(--soft-silver);
    opacity: 0.4;
}

.login-form .btn-full {
    min-height: var(--touch-target);
    font-size: 0.85rem;
}

.login-error {
    color: #ff4757;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-error.show {
    opacity: 1;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.admin-dashboard {
    display: flex;
    min-height: 100dvh;
    position: relative;
}

/* ============================================
   SIDEBAR — MOBILE FIRST (Hidden)
   ============================================ */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(var(--sidebar-width), 85vw);
    background: rgba(11, 31, 58, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transform: translateX(-105%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.admin-sidebar.active {
    transform: translateX(0);
}

/* Sidebar overlay for mobile */
.admin-sidebar::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: -1;
    left: 100%;
    width: 100vw;
}

.admin-sidebar.active::before {
    opacity: 1;
    pointer-events: all;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
}

.sidebar-brand .logo {
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transform-origin: left center;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--soft-silver);
    font-size: 0.9rem;
    font-weight: 400;
    transition: var(--transition-smooth);
    border-left: 3px solid transparent;
    min-height: var(--touch-target);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-link svg {
    opacity: 0.6;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sidebar-link:active {
    background: rgba(30, 94, 255, 0.12);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(30, 94, 255, 0.08);
    color: var(--champagne);
    border-left-color: var(--luxury-blue);
}

.sidebar-link:hover svg,
.sidebar-link.active svg {
    opacity: 1;
    color: var(--luxury-blue);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-glass);
}

.sidebar-footer .btn-sm {
    width: 100%;
    min-height: var(--touch-target);
    justify-content: center;
    font-size: 0.8rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.admin-main {
    flex: 1;
    margin-left: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ============================================
   HEADER — MOBILE OPTIMIZED
   ============================================ */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    min-height: var(--header-height);
    background: rgba(11, 31, 58, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0.75rem;
}

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: var(--touch-target);
    height: var(--touch-target);
    padding: 12px;
    border-radius: 10px;
    -webkit-tap-highlight-color: rgba(30, 94, 255, 0.15);
    transition: var(--transition-smooth);
}

.sidebar-toggle:active {
    background: rgba(30, 94, 255, 0.1);
    transform: scale(0.92);
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--champagne);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.admin-name {
    font-size: 0.8rem;
    color: var(--soft-silver);
    display: none;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--luxury-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30, 94, 255, 0.3);
}

/* ============================================
   ADMIN SECTIONS
   ============================================ */
.admin-section {
    display: none;
    padding: 1rem;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

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

.admin-section.active {
    display: block;
}

.admin-section .section-header {
    text-align: left;
    margin-bottom: 1.25rem;
}

.admin-section .section-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    font-weight: 400;
    color: var(--champagne);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.admin-section .section-header p {
    font-size: 0.8rem;
    color: var(--soft-silver);
    opacity: 0.6;
}

/* ============================================
   STATS CARDS — MOBILE GRID
   ============================================ */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stats-cards .stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: clamp(0.875rem, 3vw, 1.25rem);
    text-align: left;
    min-height: 80px;
}

.stats-cards .stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(30, 94, 255, 0.1);
    color: var(--luxury-blue);
    flex-shrink: 0;
}

.stats-cards .stat-icon svg {
    width: 20px;
    height: 20px;
}

.stats-cards .stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stats-cards .stat-value {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 4vw, 1.6rem);
    font-weight: 600;
    color: var(--champagne);
    line-height: 1.2;
}

.stats-cards .stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--soft-silver);
    opacity: 0.6;
    margin-top: 0.125rem;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

.dashboard-card {
    padding: 1.25rem;
}

.dashboard-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--champagne);
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-glass);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--soft-silver);
    opacity: 0.4;
    font-size: 0.8rem;
}

/* Recent items */
.recent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-glass);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--deep-royal);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.recent-name {
    font-size: 0.8rem;
    color: var(--champagne);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.4;
}

.recent-cat {
    font-size: 0.7rem;
    color: var(--soft-silver);
    opacity: 0.5;
    margin: 0;
}

.recent-price {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--soft-silver);
    flex-shrink: 0;
}

/* ============================================
   TOOLBAR — MOBILE STACKED
   ============================================ */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.toolbar-search {
    width: 100%;
}

.toolbar-search input {
    width: 100%;
    min-height: var(--touch-target);
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--champagne);
    font-family: var(--font-body);
    font-size: 16px; /* Prevent iOS zoom */
    outline: none;
    transition: var(--transition-smooth);
}

.toolbar-search input:focus {
    border-color: var(--luxury-blue);
    box-shadow: 0 0 0 3px rgba(30, 94, 255, 0.1);
}

.toolbar-search input::placeholder {
    color: var(--soft-silver);
    opacity: 0.4;
}

.toolbar .btn-primary {
    width: 100%;
    min-height: var(--touch-target);
    justify-content: center;
}

/* ============================================
   DATA TABLE — MOBILE HORIZONTAL SCROLL
   ============================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-glass) transparent;
}

.table-container::-webkit-scrollbar {
    height: 4px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 2px;
}

.data-table {
    width: 100%;
    min-width: 600px; /* Force scroll on mobile */
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 0.875rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--soft-silver);
    opacity: 0.6;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 0.75rem;
    color: var(--soft-silver);
    border-bottom: 1px solid rgba(201, 214, 234, 0.05);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(30, 94, 255, 0.03);
}

.data-table .product-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--deep-royal);
    display: block;
}

.data-table .product-name-cell {
    font-weight: 500;
    color: var(--champagne);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-active {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.status-inactive {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

.status-pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-processing {
    background: rgba(30, 94, 255, 0.1);
    color: var(--luxury-blue);
}

.status-shipped {
    background: rgba(138, 43, 226, 0.1);
    color: #8a2be2;
}

.status-delivered {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.status-cancelled {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
}

/* Status select in table */
.status-select {
    background: var(--card-bg);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: var(--soft-silver);
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    outline: none;
    min-height: 32px;
}

/* Table actions */
.table-actions {
    display: flex;
    gap: 0.375rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--soft-silver);
    transition: var(--transition-smooth);
    -webkit-tap-highlight-color: transparent;
}

.action-btn:active {
    transform: scale(0.9);
}

.action-btn:hover {
    background: rgba(30, 94, 255, 0.1);
    color: var(--luxury-blue);
}

.action-btn.delete:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

.empty-row td {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--soft-silver);
    opacity: 0.4;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-grid {
    max-width: 100%;
}

.settings-card {
    padding: 1.25rem;
}

.settings-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--champagne);
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-glass);
}

.settings-form .form-group {
    margin-bottom: 1.125rem;
}

.settings-form .form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--soft-silver);
    margin-bottom: 0.5rem;
}

.settings-form .form-group input {
    width: 100%;
    min-height: var(--touch-target);
    padding: 0.75rem 1rem;
    background: rgba(7, 15, 30, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--champagne);
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: var(--transition-smooth);
}

.settings-form .form-group input:focus {
    border-color: var(--luxury-blue);
    box-shadow: 0 0 0 3px rgba(30, 94, 255, 0.1);
}

.settings-form .btn-primary {
    width: 100%;
    min-height: var(--touch-target);
    margin-top: 0.5rem;
}

/* ============================================
   PRODUCT MODAL — MOBILE OPTIMIZED
   ============================================ */
.modal-header {
    padding: 1.25rem 1.25rem 0;
    position: sticky;
    top: 0;
    background: var(--card-bg-solid);
    z-index: 10;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--champagne);
    padding-right: 2rem;
}

.product-form {
    padding: 1rem 1.25rem 1.5rem;
}

.product-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

.product-form .form-group {
    margin-bottom: 0.875rem;
}

.product-form .form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--soft-silver);
    margin-bottom: 0.5rem;
}

.product-form .form-group input,
.product-form .form-group select,
.product-form .form-group textarea {
    width: 100%;
    min-height: var(--touch-target);
    padding: 0.75rem 1rem;
    background: rgba(7, 15, 30, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--champagne);
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: var(--transition-smooth);
}

.product-form .form-group input:focus,
.product-form .form-group select:focus,
.product-form .form-group textarea:focus {
    border-color: var(--luxury-blue);
    box-shadow: 0 0 0 3px rgba(30, 94, 255, 0.1);
}

.product-form .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.product-form .form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23C9D6EA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
    position: sticky;
    bottom: 0;
    background: var(--card-bg-solid);
}

.modal-actions .btn {
    width: 100%;
    min-height: var(--touch-target);
    justify-content: center;
}

/* ============================================
   IMAGE UPLOAD — MOBILE OPTIMIZED
   ============================================ */
.image-upload-area {
    position: relative;
    border: 2px dashed var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(7, 15, 30, 0.3);
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(30, 94, 255, 0.1);
}

.image-upload-area:active {
    transform: scale(0.98);
}

.image-upload-area:hover,
.image-upload-area.drag-over {
    border-color: var(--luxury-blue);
    background: rgba(30, 94, 255, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    color: var(--soft-silver);
    pointer-events: none;
}

.upload-placeholder svg {
    width: 36px;
    height: 36px;
    opacity: 0.3;
}

.upload-placeholder p {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--champagne);
}

.upload-placeholder span {
    font-size: 0.7rem;
    opacity: 0.5;
}

.upload-preview {
    position: relative;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
}

.upload-preview img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: var(--shadow-card);
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid var(--dark-bg);
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

.remove-image:active {
    transform: scale(0.9);
}

.remove-image:hover {
    transform: scale(1.1);
    background: #ff3344;
}

.upload-hint {
    font-size: 0.7rem;
    color: var(--soft-silver);
    opacity: 0.5;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.upload-hint.error {
    color: #ff4757;
    opacity: 1;
}

.image-upload-area.uploading {
    pointer-events: none;
    opacity: 0.7;
}

.image-upload-area.uploading::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: var(--luxury-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(201, 214, 234, 0.2);
    border-top-color: var(--luxury-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* ============================================
   PAGINATION — MOBILE
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--soft-silver);
    font-size: 0.85rem;
    transition: var(--transition-smooth);
    -webkit-tap-highlight-color: transparent;
}

.page-btn:active {
    transform: scale(0.92);
}

.page-btn:hover,
.page-btn.active {
    background: var(--luxury-blue);
    border-color: var(--luxury-blue);
    color: white;
}

.page-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    color: var(--soft-silver);
    opacity: 0.5;
    padding: 0 0.25rem;
}

/* ============================================
   EXPORT BUTTONS
   ============================================ */
.export-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.export-actions .btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    min-height: 36px;
}

/* ============================================
   TABLE RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 640px) {
    .data-table .hide-mobile {
        display: none;
    }
    
    .data-table {
        min-width: 100%;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.625rem 0.5rem;
    }
    
    .data-table .product-thumb {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   TABLET BREAKPOINT (641px - 1023px)
   ============================================ */
@media (min-width: 641px) and (max-width: 1023px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .product-form .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .toolbar {
        flex-direction: row;
        align-items: center;
    }
    
    .toolbar .btn-primary {
        width: auto;
    }
    
    .modal-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .modal-actions .btn {
        width: auto;
    }
}

/* ============================================
   DESKTOP BREAKPOINT (1024px+)
   ============================================ */
@media (min-width: 1024px) {
    :root {
        --header-height: 64px;
    }
    
    .admin-sidebar {
        transform: translateX(0);
        position: fixed;
        box-shadow: none;
    }
    
    .admin-sidebar::before {
        display: none;
    }
    
    .admin-main {
        margin-left: var(--sidebar-width);
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .admin-name {
        display: block;
    }
    
    .admin-header {
        padding: 0.75rem 1.5rem;
    }
    
    .admin-section {
        padding: 1.5rem;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stats-cards .stat-card {
        padding: 1.25rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .toolbar {
        flex-direction: row;
        align-items: center;
    }
    
    .toolbar-search {
        max-width: 320px;
    }
    
    .toolbar .btn-primary {
        width: auto;
    }
    
    .table-container {
        margin: 0;
        padding: 0;
    }
    
    .data-table {
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 1rem;
    }
    
    .product-form .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .modal-actions .btn {
        width: auto;
    }
    
    .settings-grid {
        max-width: 600px;
    }
    
    .export-actions {
        justify-content: flex-end;
    }
}

/* ============================================
   LARGE DESKTOP (1400px+)
   ============================================ */
@media (min-width: 1400px) {
    .admin-section {
        padding: 2rem;
    }
    
    .stats-cards {
        gap: 1.25rem;
    }
    
    .dashboard-grid {
        gap: 1.5rem;
    }
}

/* ============================================
   LANDSCAPE MOBILE OPTIMIZATION
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .admin-login-overlay {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .login-card {
        max-width: 360px;
    }
    
    .admin-sidebar {
        width: 240px;
    }
    
    .sidebar-link {
        min-height: 40px;
        padding: 0.625rem 1rem;
    }
}

/* ============================================
   SAFE AREA INSETS (Notch devices)
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
    .admin-sidebar {
        padding-top: env(safe-area-inset-top);
    }
    
    .admin-header {
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .admin-sidebar,
    .page-btn,
    .action-btn,
    .sidebar-toggle,
    .remove-image,
    .image-upload-area {
        transition: none !important;
    }
    
    .admin-sidebar {
        transition: transform 0.1s ease !important;
    }
}