/* ========================================
   RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   NAVIGATION
======================================== */
.nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav .brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    color: #1f2937;
    flex-shrink: 0;
    padding: 0.5rem 0;
}

.nav .brand img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.nav .brand span {
    color: #047857;
    white-space: nowrap;
}

/* Desktop Navigation Links */
.nav-links {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.nav a:not(.brand):not(.nav-toggle) {
    text-decoration: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav a:not(.brand):not(.nav-toggle):hover,
.nav a:not(.brand):not(.nav-toggle):focus {
    color: #047857;
    background: #f0fdf4;
    outline: none;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.625rem;
    color: #1f2937;
    font-size: 1.5rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-toggle:hover,
.nav-toggle:focus {
    color: #047857;
    background: #f3f4f6;
    outline: none;
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Mobile Menu Overlay */
.mobile-overlay,
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active,
.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu */
.mobile-menu,
.nav-mobile-menu {
    position: fixed;
    top: 64px;
    right: -100%;
    width: min(320px, 85vw);
    height: calc(100vh - 64px);
    background: #ffffff;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 99;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.mobile-menu.active,
.nav-mobile-menu.active {
    right: 0;
}

.mobile-menu-content,
.nav-mobile-links {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.mobile-menu-header,
.nav-mobile-menu-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-header p {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.mobile-menu-header small {
    font-size: 0.75rem;
    color: #6b7280;
}

.nav-mobile-menu-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    padding: 0;
    border: none;
}

.nav-mobile-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #6b7280;
    font-size: 1.5rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-mobile-close:hover,
.nav-mobile-close:focus {
    color: #1f2937;
    background: #f3f4f6;
    outline: none;
}

.mobile-menu a,
.nav-mobile-links a {
    padding: 0.875rem 1rem;
    color: #1f2937;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-menu a:last-child,
.nav-mobile-links a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover,
.mobile-menu a:focus,
.nav-mobile-links a:hover,
.nav-mobile-links a:focus {
    background: #f9fafb;
    color: #047857;
    outline: none;
}

.mobile-menu a:active,
.nav-mobile-links a:active {
    transform: scale(0.98);
}

.mobile-menu a.logout {
    color: #dc2626;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.mobile-menu a.logout:hover {
    background: #fef2f2;
}

/* ========================================
   ADMIN HEADER
======================================== */
.admin-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
    font-weight: 700;
    color: #1f2937;
}

.admin-header nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-header nav a {
    text-decoration: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.admin-header nav a:hover,
.admin-header nav a:focus {
    color: #047857;
    background: #f0fdf4;
    outline: none;
}

/* ========================================
   CONTAINERS
======================================== */
.dashboard,
.admin-container,
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ========================================
   TOPBAR & HEADERS
======================================== */
.topbar {
    margin-bottom: 1.5rem;
}

.topbar h2 {
    font-size: clamp(1.375rem, 4vw, 1.75rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.header h2 {
    font-size: clamp(1.375rem, 4vw, 1.75rem);
    font-weight: 700;
    color: #1f2937;
}

.top-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.top-bar h2 {
    font-size: clamp(1.375rem, 4vw, 1.75rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

/* Page Header */
.container h2 {
    font-size: clamp(1.375rem, 4vw, 1.75rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.25rem;
}

/* ========================================
   TEXT UTILITIES
======================================== */
.muted {
    color: #6b7280;
    font-size: clamp(0.8125rem, 2vw, 0.875rem);
}

/* ========================================
   KPI CARDS
======================================== */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #e5e7eb;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover,
.card:focus {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    outline: 2px solid #047857;
    outline-offset: 2px;
}

.card:active {
    transform: translateY(0);
}

.card h3 {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
    padding: 0;
    border: none;
    line-height: 1.4;
}

.card p {
    font-size: clamp(1.75rem, 5vw, 2rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.card small {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    color: #6b7280;
    line-height: 1.5;
}

.change-positive {
    color: #10b981 !important;
    font-weight: 600;
}

.change-negative {
    color: #ef4444 !important;
    font-weight: 600;
}

/* ========================================
   SUMMARY BOXES
======================================== */
.summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.box {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.box span {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.box:not(:has(span)) {
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: 700;
    color: #1f2937;
}

/* ========================================
   CHARTS
======================================== */
.chart-container {
    background: #ffffff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.chart-title {
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

canvas {
    max-width: 100%;
    height: auto !important;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* ========================================
   FORMS & INPUTS
======================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-group input[type="file"] {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

/* Inline form groups (for checkboxes) */
.form-group.inline,
.inline {
    display: flex;
    gap: 0.625rem;
    align-items: center;
}

.inline input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.inline label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #047857;
}

input[type="checkbox"]:focus {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

/* Validation Styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
    border-color: #f87171;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Form Improvements */
#productForm {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* ========================================
   SIZE TABLES & ROWS
======================================== */
.size-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    min-width: 500px;
}

.size-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.size-table th {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: clamp(0.6875rem, 2vw, 0.8125rem);
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.size-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}

.size-table tbody tr:last-child td {
    border-bottom: none;
}

.size-table tbody tr:hover {
    background: #f9fafb;
}

.size-table input {
    width: 100%;
    min-width: 80px;
    padding: 0.5rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    text-align: center;
}

.size-table input:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.1);
}

.size-table button {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
}

.size-table button:hover {
    background: #fecaca;
    color: #7f1d1d;
}

/* Size Rows */
.size-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-wrap: wrap;
    animation: slideDown 0.2s ease-out;
}

.size-row input[type="text"],
.size-row input[type="number"] {
    flex: 1;
    min-width: 100px;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: #ffffff;
}

.size-row input:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.1);
}

.size-row label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
    margin: 0;
}

.size-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #dc2626;
}

.size-row .remove-btn {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
}

.size-row .remove-btn:hover {
    background: #fecaca;
    color: #7f1d1d;
}

#newSizes {
    margin-bottom: 0.75rem;
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    min-height: 44px;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #111827;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-add {
    background: #374151;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.btn-add:hover {
    background: #1f2937;
}

.btn-nav {
    background: #4b5563;
    color: #ffffff;
    margin-right: 0.75rem;
    padding: 0.625rem 1.125rem;
}

.btn-nav:hover {
    background: #374151;
}

.btn-success-link {
    background: #059669;
    color: #ffffff;
    text-decoration: none;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    display: inline-block;
    margin-left: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-success-link:hover {
    background: #047857;
    transform: translateY(-1px);
}

/* ========================================
   ALERTS & MESSAGES
======================================== */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

.alert li {
    margin: 0.25rem 0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.error {
    color: #dc2626;
    background: #fee2e2;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.success {
    color: #065f46;
    background: #d1fae5;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: inline-block;
    font-weight: 500;
    font-size: 0.875rem;
}

/* ========================================
   IMAGE PREVIEW & BOX
======================================== */
#image-preview {
    display: none;
    max-width: 200px;
    max-height: 200px;
    margin-top: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.25rem;
    object-fit: cover;
}

.image-box {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.image-box img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.image-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 2px dashed #d1d5db;
    flex-shrink: 0;
}

.image-box > div {
    flex: 1;
    min-width: 200px;
}

/* ========================================
   BADGES
======================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #d1fae5;
    color: #047857;
}

.badge-primary {
    background: #d1fae5;
    color: #065f46;
}

.badge-muted {
    background: #f3f4f6;
    color: #6b7280;
}

.slug-preview {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.375rem;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    background: #f9fafb;
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    border-left: 3px solid #047857;
}

/* ========================================
   FILTERS
======================================== */
.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.filters input[type="text"],
.filters input[type="date"],
.filters select {
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s;
    min-width: 180px;
    min-height: 44px;
}

.filters input[type="text"]:focus,
.filters input[type="date"]:focus,
.filters select:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

.filters button[type="submit"],
.filters button {
    padding: 0.625rem 1.25rem;
    background: #047857;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.filters button:hover {
    background: #065f46;
}

.filters a {
    padding: 0.625rem 1.25rem;
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.filters a:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* ========================================
   BULK BAR
======================================== */
.bulk-bar {
    background: #f0fdf4;
    border: 1px solid #a7f3d0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.bulk-bar strong {
    color: #047857;
    font-size: 0.875rem;
}

.bulk-bar button,
.bulk-bar select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.bulk-bar button {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.bulk-bar button:hover {
    background: #dc2626;
}

.bulk-bar select {
    background: #ffffff;
    color: #1f2937;
}

/* ========================================
   GRID & PANELS
======================================== */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.panel {
    background: #ffffff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel h4 {
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

/* ========================================
   TABLES
======================================== */
.table-wrap {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
}

.panel .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -1rem;
    padding: 1rem;
    background: transparent;
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    min-width: 1100px;
}

thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

thead th {
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-size: clamp(0.6875rem, 2vw, 0.75rem);
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

thead th a {
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

thead th a:hover {
    color: #047857;
}

tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr[onclick] {
    cursor: pointer;
}

tbody td {
    padding: 1rem 0.75rem;
    font-size: clamp(0.8125rem, 2vw, 0.875rem);
    color: #1f2937;
    white-space: nowrap;
}

.thumb {
    width: 60px;
    height: 60px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    color: #9ca3af;
    font-weight: 500;
}

td img {
    border-radius: 8px;
    object-fit: cover;
}

/* Scrollbar styling for better UX */
.table-wrap::-webkit-scrollbar {
    height: 8px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Scroll indicator for mobile */
@media (max-width: 47.9375em) {
    .table-wrap {
        position: relative;
    }
    
    .table-wrap::after {
        content: '← Scroll →';
        position: absolute;
        bottom: 0;
        right: 0;
        background: linear-gradient(to left, #ffffff 0%, #ffffff 50%, transparent 100%);
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        color: #6b7280;
        font-weight: 600;
        pointer-events: none;
        border-radius: 0 0 12px 0;
    }
    
    .table-wrap.scrolled-end::after {
        display: none;
    }
}

/* ========================================
   TABLE ACTIONS
======================================== */
.table-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.table-actions a,
.edit,
.delete,
.view {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    min-height: 44px;
    line-height: 2;
}

.edit {
    background: #f0fdf4;
    color: #047857;
}

.edit:hover {
    background: #d1fae5;
    color: #065f46;
}

.delete {
    background: #fef2f2;
    color: #dc2626;
}

.delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.view {
    background: #f0fdf4;
    color: #16a34a;
}

.view:hover {
    background: #dcfce7;
    color: #15803d;
}

/* ========================================
   PAGINATION
======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.pagination .pages {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: #6b7280;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    min-width: 40px;
    min-height: 44px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination a:hover {
    color: #047857;
    background: #f0fdf4;
    border-color: #047857;
}

.pagination span.active,
.pagination a.active {
    background: #047857;
    color: #ffffff;
    border-color: #047857;
}

/* ========================================
   SPECIAL TABLE COLUMNS
======================================== */
.email {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.125rem;
    display: block;
}

.orders {
    font-weight: 600;
    color: #047857;
}

.money {
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
}

.alert {
    color: #dc2626;
    font-weight: 700;
}

/* ========================================
   EMPTY STATE
======================================== */
.empty,
p.empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
}

/* ========================================
   UTILITY SECTIONS
======================================== */
.actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1.25rem;
    border-top: 2px solid #f3f4f6;
}

.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 1.75rem 0;
}

h3 {
    font-size: clamp(1rem, 3vw, 1.125rem);
    font-weight: 700;
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f3f4f6;
}

#productForm h3:first-of-type {
    margin-top: 0;
}

small {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.375rem;
}

/* ========================================
   ACCESSIBILITY
======================================== */
.btn:focus,
input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   LOADING STATE
======================================== */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE BREAKPOINTS
======================================== */

/* Small phones (475px and up) */
@media (min-width: 29.6875em) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (640px and up) */
@media (min-width: 40em) {
    .dashboard,
    .admin-container,
    .container {
        padding: 2rem 1.5rem;
    }
    
    .topbar,
    .header,
    .top-bar {
        margin-bottom: 2rem;
    }
    
    .cards,
    .summary {
        gap: 1.25rem;
        margin-bottom: 2rem;
    }
    
    .card,
    .box {
        padding: 1.5rem;
    }
    
    .chart-container,
    canvas {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .chart-wrapper {
        height: 350px;
    }
    
    .panel {
        padding: 1.5rem;
    }
    
    .grid {
        gap: 2rem;
    }
    
    #productForm {
        padding: 1.75rem;
    }
}

/* Desktop (768px and up) */
@media (min-width: 48em) {
    .nav {
        padding: 0 1.5rem;
    }
    
    .nav-toggle {
        display: none;
    }
    
    .nav-links {
        display: flex;
    }
    
    .mobile-menu,
    .mobile-overlay,
    .nav-mobile-menu,
    .nav-overlay {
        display: none !important;
    }
    
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .summary {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid {
        grid-template-columns: 2fr 1fr;
    }
    
    .table-actions {
        gap: 0.75rem;
    }
    
    .table-actions a {
        line-height: 1.5;
    }
}

/* Large desktop (1024px and up) */
@media (min-width: 64em) {
    .nav {
        padding: 0 2rem;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .dashboard,
    .admin-container,
    .container {
        padding: 2rem;
    }
    
    .cards {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .chart-wrapper {
        height: 400px;
    }
    
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

/* Extra large desktop (1280px and up) */
@media (min-width: 80em) {
    .chart-container,
    canvas {
        padding: 2rem;
    }
    
    .panel {
        padding: 2rem;
    }
    
    #productForm {
        padding: 2rem;
    }
}

/* Ultra-wide (1536px and up) */
@media (min-width: 96em) {
    .dashboard,
    .admin-container,
    .container {
        padding: 2.5rem 2rem;
    }
}

/* ========================================
   MOBILE OPTIMIZATIONS
======================================== */
@media (max-width: 47.9375em) {
    .admin-header {
        flex-direction: column;
        min-height: auto;
        padding: 1rem;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .admin-header nav {
        flex-wrap: wrap;
        width: 100%;
        gap: 0.5rem;
    }
    
    .filters {
        flex-direction: column;
        padding: 1rem;
    }
    
    .filters input,
    .filters select,
    .filters button,
    .filters a {
        width: 100%;
        min-width: auto;
    }
    
    .pagination {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    
    .pagination .pages {
        justify-content: center;
    }
    
    .image-box {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .image-box img,
    .image-placeholder {
        width: 100%;
        max-width: 300px;
        height: auto;
        aspect-ratio: 1;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
    }
    
    .btn-nav,
    .btn-success-link {
        margin: 0 0 0.5rem 0;
        width: 100%;
    }
}

@media (max-width: 39.9375em) {
    .cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card,
    .box {
        padding: 1rem;
    }
    
    .card p {
        font-size: clamp(1.5rem, 6vw, 1.75rem);
    }
    
    .size-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }
    
    .size-row input[type="text"],
    .size-row input[type="number"] {
        width: 100%;
        min-width: auto;
    }
    
    .size-row label {
        width: 100%;
        justify-content: space-between;
    }
    
    .size-row .remove-btn {
        width: 100%;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Extra small devices */
@media (max-width: 29.9375em) {
    .dashboard,
    .admin-container,
    .container {
        padding: 1rem 0.75rem;
    }
    
    .nav {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .card,
    .box {
        padding: 0.875rem;
    }
    
    #productForm {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    table {
        min-width: 600px;
        font-size: 0.8125rem;
    }
    
    tbody td {
        padding: 0.75rem;
    }
    
    .thumb {
        width: 48px;
        height: 48px;
        font-size: 0.625rem;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION
======================================== */
@media (max-width: 48em) and (orientation: landscape) {
    .nav {
        min-height: 56px;
    }
    
    .admin-header {
        flex-direction: row;
        min-height: 56px;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .nav,
    .nav-toggle,
    .mobile-menu,
    .mobile-overlay,
    .nav-mobile-menu,
    .nav-overlay,
    .btn,
    .btn-nav,
    .btn-add,
    .actions,
    .filters,
    .bulk-bar {
        display: none !important;
    }
    
    .dashboard,
    .admin-container,
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .card,
    .panel,
    .chart-container,
    #productForm {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }
    
    .table-wrap {
        box-shadow: none;
    }
    
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   REDUCED MOTION
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   HIGH CONTRAST MODE
======================================== */
@media (prefers-contrast: high) {
    .card,
    .panel,
    .box,
    .chart-container,
    #productForm {
        border: 2px solid #1f2937;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ========================================
   DARK MODE SUPPORT (OPTIONAL)
======================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode support
    body {
        background: #111827;
        color: #f9fafb;
    }
    
    .nav,
    .admin-header,
    .card,
    .panel,
    .box,
    .chart-container,
    #productForm,
    .mobile-menu,
    .nav-mobile-menu {
        background: #1f2937;
        border-color: #374151;
    }
    
    .card h3,
    .muted,
    small {
        color: #9ca3af;
    }
    
    input,
    textarea,
    select {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    */
}

/* ========================================
   PRODUCT ADD PAGE - RESPONSIVE STYLES
======================================== */

/* Header Actions */
.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Form Sections */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Alert Actions */
.alert p {
    margin: 0 0 0.5rem 0;
}

.alert-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-success-secondary {
    background: #6b7280 !important;
}

.btn-success-secondary:hover {
    background: #4b5563 !important;
}

/* Required Asterisk */
.required {
    color: #dc2626;
}

/* Sizes Card */
.sizes-card {
    margin-top: 1.5rem;
}

.sizes-description {
    margin-bottom: 1rem;
}

/* Image Preview Container */
.image-preview-container {
    margin-top: 0.75rem;
}

#image-preview {
    display: none;
    max-width: 100%;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-top: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.25rem;
    object-fit: cover;
}

/* Action Column in Size Table */
.action-col {
    width: 100px;
    text-align: center;
}

.btn-remove {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 40px;
    width: 100%;
    max-width: 120px;
}

.btn-remove:hover {
    background: #fecaca;
    color: #7f1d1d;
}

/* Size Table Responsive Scrollbar */
.size-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.size-table-wrapper::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.size-table-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.size-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ========================================
   TABLET RESPONSIVE (640px and up)
======================================== */
@media (min-width: 40em) {
    .btn-add {
        width: auto;
    }
    
    .alert-actions {
        display: inline-flex;
    }
    
    .btn-success-link {
        margin-left: 0;
    }
}

/* ========================================
   DESKTOP RESPONSIVE (768px and up)
======================================== */
@media (min-width: 48em) {
    .header-actions {
        flex-wrap: nowrap;
    }
}

/* ========================================
   MOBILE RESPONSIVE (below 768px)
======================================== */
@media (max-width: 47.9375em) {
    /* Header */
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header > div:first-child {
        width: 100%;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1;
    }
    
    /* Alert Actions */
    .alert-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .alert-actions .btn-success-link {
        width: 100%;
        text-align: center;
        margin: 0;
    }
    
    /* Form Grid */
    .form-grid {
        gap: 1rem;
    }
    
    /* Actions Section */
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
    }
    
    /* Size Table - Responsive Layout */
    .size-table-wrapper {
        position: relative;
    }
    
    .size-table-wrapper::after {
        content: '← Swipe to see more →';
        position: absolute;
        bottom: 0.5rem;
        right: 0.5rem;
        background: rgba(4, 120, 87, 0.9);
        color: #ffffff;
        padding: 0.25rem 0.75rem;
        border-radius: 4px;
        font-size: 0.6875rem;
        font-weight: 600;
        pointer-events: none;
        animation: pulse 2s infinite;
    }
    
    .size-table-wrapper.scrolled::after {
        display: none;
    }
    
    /* Size Table Inputs - Better mobile sizing */
    .size-table input {
        min-width: 70px;
        font-size: 0.8125rem;
    }
    
    .size-table th,
    .size-table td {
        padding: 0.625rem 0.5rem;
    }
    
    .btn-remove {
        font-size: 0.6875rem;
        padding: 0.375rem 0.5rem;
        max-width: 100%;
    }
}

/* ========================================
   SMALL MOBILE (below 640px)
======================================== */
@media (max-width: 39.9375em) {
    /* Form padding */
    #productForm {
        padding: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    /* Size Table - Card Layout for very small screens */
    .size-table thead {
        position: absolute;
        left: -9999px;
    }
    
    .size-table,
    .size-table tbody,
    .size-table tr,
    .size-table td {
        display: block;
        width: 100%;
    }
    
    .size-table {
        min-width: auto;
        border: none;
    }
    
    .size-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 0.75rem;
        background: #f9fafb;
        display: block;
    }
    
    .size-table td {
        border: none;
        padding: 0.5rem 0;
        text-align: left !important;
        position: relative;
        padding-left: 45%;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .size-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 40%;
        padding-right: 0.5rem;
        font-weight: 600;
        color: #6b7280;
        font-size: 0.8125rem;
        text-align: left;
    }
    
    .size-table td input {
        width: 100%;
        text-align: left;
    }
    
    .size-table td.action-col {
        padding-left: 0;
        margin-top: 0.5rem;
    }
    
    .size-table td.action-col::before {
        display: none;
    }
    
    .btn-remove {
        max-width: 100%;
        width: 100%;
    }
    
    /* Image Preview */
    #image-preview {
        max-width: 100%;
    }
    
    /* Button Add */
    .btn-add {
        width: 100%;
    }

    .login-logo {
        width: 100px;
        height: 100px;
    }
}

/* ========================================
   EXTRA SMALL DEVICES (below 480px)
======================================== */
@media (max-width: 29.9375em) {
    .nav {
        padding: 0.5rem;
    }
    
    .admin-container,
    .container {
        padding: 1rem 0.75rem;
    }
    
    #productForm {
        padding: 0.875rem;
    }
    
    .card {
        padding: 0.875rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    h3 {
        font-size: 1rem;
    }

    .login-logo {
        width: 80px;
        height: 80px;
        padding: 0.75rem;
    }
}

/* ========================================
   PULSE ANIMATION FOR SCROLL INDICATOR
======================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ========================================
   LANDSCAPE MODE (mobile devices)
======================================== */
@media (max-width: 48em) and (orientation: landscape) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1rem;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets on touch devices */
    .btn,
    .form-group input,
    .form-group textarea,
    .form-group select,
    .size-table input,
    .btn-remove {
        min-height: 44px;
    }
    
    /* Remove hover states on touch devices */
    .btn:hover,
    .card:hover {
        transform: none;
    }
}

/* ========================================
   PRODUCT EDIT PAGE - ADDITIONAL STYLES
======================================== */

/* Character Counter */
.char-count {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    float: right;
}

/* Actions Section with "Add New Product" on right */
.actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1.25rem;
    border-top: 2px solid #f3f4f6;
    align-items: center;
}

.actions .btn[style*="margin-left: auto"] {
    margin-left: auto;
}

/* Image Box Responsive */
.image-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.image-box img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.image-box > div {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Size Row Delete Checkbox */
.size-row label input[type="checkbox"] {
    accent-color: #dc2626;
}

.size-row label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #dc2626;
    white-space: nowrap;
    margin: 0;
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.size-row label:hover {
    background: #fee2e2;
}

/* Empty State for No Sizes */
.card > p.muted {
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
    margin: 0;
}

/* ========================================
   MOBILE RESPONSIVE FOR EDIT PAGE
======================================== */
@media (max-width: 47.9375em) {
    /* Header Actions */
    .header > div:last-child {
        width: 100%;
    }
    
    .header > div:last-child .btn {
        width: 100%;
    }
    
    /* Actions Section - Stack all buttons */
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
        margin-left: 0 !important;
    }
    
    /* Image Box - Stack vertically */
    .image-box {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .image-box img,
    .image-placeholder {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
    
    .image-box > div {
        width: 100%;
        min-width: auto;
    }
    
    /* Size Rows - Better mobile layout */
    .size-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }
    
    .size-row input[type="text"],
    .size-row input[type="number"],
    .size-row input[type="hidden"] + input {
        width: 100%;
        min-width: auto;
    }
    
    .size-row label {
        width: 100%;
        justify-content: flex-start;
        padding: 0.625rem;
        background: #fef2f2;
        border-radius: 6px;
        color: #991b1b;
        font-weight: 600;
    }
    
    .size-row label:hover {
        background: #fee2e2;
    }
    
    /* Character Counter - Stack below input */
    .char-count {
        float: none;
        display: block;
        margin-top: 0.375rem;
    }
}

/* ========================================
   SMALL MOBILE FOR EDIT PAGE
======================================== */
@media (max-width: 39.9375em) {
    /* Ensure all form elements are readable */
    .form-group label {
        font-size: 0.875rem;
    }
    
    .slug-preview {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        word-break: break-all;
    }
    
    /* Size Row Inputs */
    .size-row input {
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* Button sizing */
    .btn-add {
        width: 100%;
        padding: 0.75rem 1rem;
    }
}

/* ========================================
   EXTRA SMALL DEVICES FOR EDIT PAGE
======================================== */
@media (max-width: 29.9375em) {
    /* Tighter spacing */
    .size-row {
        padding: 0.625rem;
        gap: 0.5rem;
    }
    
    .size-row input {
        padding: 0.625rem;
    }
    
    /* Image Box */
    .image-box {
        padding: 0.625rem;
    }
    
    .image-box img {
        width: 100%;
    }
}

/* ========================================
   TABLET OPTIMIZATION FOR EDIT PAGE
======================================== */
@media (min-width: 40em) and (max-width: 47.9375em) {
    /* Keep actions in a row on tablets */
    .actions {
        flex-direction: row;
    }
    
    .actions .btn {
        flex: 1;
    }
    
    .actions .btn[style*="margin-left: auto"] {
        flex: 0 0 auto;
    }
}

/* ========================================
   DESKTOP OPTIMIZATION FOR EDIT PAGE
======================================== */
@media (min-width: 48em) {
    /* Keep margin-left auto working on desktop */
    .actions {
        flex-direction: row;
    }
    
    .actions .btn {
        width: auto;
    }
    
    /* Image box side by side */
    .image-box {
        flex-direction: row;
    }
    
    .image-box img {
        width: 160px;
        height: 160px;
    }
    
    /* Size rows horizontal layout */
    .size-row {
        flex-direction: row;
        align-items: center;
    }
    
    .size-row label {
        width: auto;
        background: transparent;
        padding: 0;
    }
    
    .size-row label:hover {
        background: #fee2e2;
        padding: 0.375rem 0.5rem;
        border-radius: 4px;
    }
}

/* ========================================
   LANDSCAPE MODE FOR EDIT PAGE
======================================== */
@media (max-width: 48em) and (orientation: landscape) {
    .image-box {
        flex-direction: row;
    }
    
    .image-box img {
        width: 120px;
        height: 120px;
    }
}

/* ========================================
   FOCUS STATES FOR EDIT PAGE
======================================== */
.size-row input[type="checkbox"]:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.size-row label:focus-within {
    background: #fee2e2;
}

/* ========================================
   LOGIN PAGE STYLES
======================================== */
body.login-page {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease-out;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 2rem;
    animation: slideDown 0.4s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 120px;
    height: 120px;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 15px -3px rgba(4, 120, 87, 0.3);
    padding: 1rem;
    border: 3px solid #047857;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-logo svg {
    width: 32px;
    height: 32px;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.login-header h1 {
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #6b7280;
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.form-field label svg {
    width: 16px;
    height: 16px;
    stroke: #6b7280;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.input-wrapper {
    position: relative;
}

.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s;
    font-family: inherit;
}

.form-field input:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.1);
}

.form-field input::placeholder {
    color: #9ca3af;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: #6b7280;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.password-toggle:hover {
    color: #047857;
    background: #f3f4f6;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Remember Me */
.remember-forgot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #047857;
}

.remember-me label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

.forgot-password {
    font-size: 0.875rem;
    color: #047857;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: #10b981;
    text-decoration: underline;
}

/* Submit Button */
.login-submit {
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(4, 120, 87, 0.3);
}

.login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(4, 120, 87, 0.4);
}

.login-submit:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-submit svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Loading State */
.login-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.login-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spinner 0.6s linear infinite;
}

/* Alerts */
.login-error,
.login-success {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    animation: slideDown 0.3s ease-out;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.login-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.login-error svg,
.login-success svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    font-size: 0.875rem;
    color: #6b7280;
}

.login-footer a {
    color: #047857;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: #10b981;
    text-decoration: underline;
}

/* Copyright */
.login-copyright {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.login-copyright p {
    margin: 0;
}

/* Background Decorations */
.bg-decoration {
    position: fixed;
    border-radius: 50%;
    opacity: 0.1;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.bg-decoration:nth-child(1) {
    width: 400px;
    height: 400px;
    background: #ffffff;
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.bg-decoration:nth-child(2) {
    width: 300px;
    height: 300px;
    background: #ffffff;
    bottom: -150px;
    right: -150px;
    animation-delay: 2s;
}

/* Hidden by default */
.hidden {
    display: none;
}

/* ========================================
   LOGIN PAGE ANIMATIONS
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

/* ========================================
   LOGIN PAGE RESPONSIVE
======================================== */

/* Tablets (640px and up) */
@media (min-width: 40em) {
    .login-card {
        padding: 2.5rem;
    }
    
    .login-form {
        gap: 1.5rem;
    }
}

/* Desktop (768px and up) */
@media (min-width: 48em) {
    .login-card {
        padding: 3rem;
    }
}

/* Small mobile (below 640px) */
@media (max-width: 39.9375em) {
    body.login-page {
        padding: 0.75rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .login-header {
        margin-bottom: 1.5rem;
    }
    
    .login-logo {
        width: 56px;
        height: 56px;
    }
    
    .login-logo svg {
        width: 28px;
        height: 28px;
    }
    
    .form-field input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Extra small (below 475px) */
@media (max-width: 29.6875em) {
    .login-card {
        padding: 1.25rem;
    }
    
    .login-form {
        gap: 1rem;
    }
}

/* Landscape mode */
@media (max-width: 48em) and (orientation: landscape) {
    body.login-page {
        padding: 1rem 0.5rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .login-header {
        margin-bottom: 1rem;
    }
    
    .login-logo {
        width: 64px;
        height: 64px;
        padding: 0.5rem;
    }
    
    .login-form {
        gap: 1rem;
    }
}

/* ========================================
   LOGIN PAGE PRINT STYLES
======================================== */
@media print {
    body.login-page {
        background: #ffffff;
    }
    
    .bg-decoration {
        display: none;
    }
    
    .login-footer,
    .forgot-password {
        display: none;
    }
}

/* ========================================
   ORDER VIEW PAGE STYLES
   Add these styles to the end of your admin.css file
======================================== */

/* Header Actions */
.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Text Alignment Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Info Display Fields */
.info-display {
    padding: 0.625rem 0.875rem;
    background: #f9fafb;
    border-radius: 8px;
    color: #1f2937;
    font-size: 0.875rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    line-height: 1.5;
}

.info-display.address-field {
    min-height: 60px;
    align-items: flex-start;
    padding-top: 0.75rem;
}

.info-display.order-ref {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: #f0fdf4;
    border-color: #10b981;
}

/* Order Info Grid */
.order-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.info-section {
    display: flex;
    flex-direction: column;
}

.info-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

/* Order Timeline Grid */
.order-timeline-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Order Items Table */
.order-items-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    min-width: 700px;
}

.order-items-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.order-items-table thead th {
    padding: 0.875rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.order-items-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.order-items-table tbody tr:hover {
    background: #f9fafb;
}

.order-items-table tbody td {
    padding: 1rem 0.75rem;
    font-size: 0.875rem;
    color: #1f2937;
}

.order-items-table tfoot {
    border-top: 2px solid #e5e7eb;
}

.order-total-row {
    background: #f9fafb !important;
    font-weight: 700;
}

.order-total-row td {
    padding: 1rem 0.75rem !important;
    font-size: 1rem;
}

/* ========================================
   ORDER VIEW PAGE RESPONSIVE
======================================== */

/* Tablets (640px and up) */
@media (min-width: 40em) {
    .order-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .order-timeline-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Desktop (768px and up) */
@media (min-width: 48em) {
    .order-info-grid {
        gap: 3rem;
    }
    
    .header-actions {
        flex-wrap: nowrap;
    }
}

/* Mobile Responsive */
@media (max-width: 47.9375em) {
    .order-info-grid {
        gap: 1.5rem;
    }
    
    .info-section h3 {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }
    
    .order-timeline-grid {
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1;
    }
}

/* Small Mobile */
@media (max-width: 39.9375em) {
    .info-display {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
    
    .order-total-row td {
        font-size: 0.9375rem;
    }
}

/* Message Card Styles */
        .messages-layout {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }
        
        .message-card {
            background: #ffffff;
            border-radius: 12px;
            border: 2px solid #e5e7eb;
            overflow: hidden;
            transition: all 0.2s;
            cursor: pointer;
        }
        
        .message-card:hover {
            border-color: #047857;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
        }
        
        .message-card.unread {
            border-left: 4px solid #047857;
            background: #f0fdf4;
        }
        
        .message-header {
            padding: 1.25rem;
            display: grid;
            grid-template-columns: auto 1fr auto;
            gap: 1rem;
            align-items: start;
            border-bottom: 1px solid #f3f4f6;
        }
        
        .message-checkbox {
            display: flex;
            align-items: center;
            padding-top: 0.25rem;
        }
        
        .message-checkbox input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: #047857;
        }
        
        .message-info {
            flex: 1;
            min-width: 0;
        }
        
        .message-sender {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.5rem;
            flex-wrap: wrap;
        }
        
        .sender-name {
            font-weight: 700;
            font-size: 1rem;
            color: #1f2937;
        }
        
        .sender-email {
            font-size: 0.8125rem;
            color: #6b7280;
        }
        
        .message-subject {
            font-weight: 600;
            font-size: 0.9375rem;
            color: #374151;
            margin-bottom: 0.375rem;
        }
        
        .message-meta {
            display: flex;
            align-items: center;
            gap: 1rem;
            font-size: 0.75rem;
            color: #9ca3af;
            flex-wrap: wrap;
        }
        
        .message-date {
            display: flex;
            align-items: center;
            gap: 0.375rem;
        }
        
        .message-actions {
            display: flex;
            gap: 0.5rem;
            align-items: flex-start;
        }
        
        .message-action-btn {
            padding: 0.5rem;
            border-radius: 6px;
            background: transparent;
            border: 1px solid #e5e7eb;
            color: #6b7280;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 36px;
            min-height: 36px;
        }
        
        .message-action-btn:hover {
            background: #f9fafb;
            color: #1f2937;
            border-color: #d1d5db;
        }
        
        .message-action-btn.mark-read:hover {
            background: #f0fdf4;
            color: #047857;
            border-color: #047857;
        }
        
        .message-action-btn.delete:hover {
            background: #fef2f2;
            color: #dc2626;
            border-color: #dc2626;
        }
        
        .message-body {
            padding: 1.25rem;
            display: none;
        }
        
        .message-body.show {
            display: block;
        }
        
        .message-text {
            font-size: 0.9375rem;
            line-height: 1.7;
            color: #374151;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        
        .message-footer {
            padding: 1rem 1.25rem;
            background: #f9fafb;
            border-top: 1px solid #e5e7eb;
            display: none;
        }
        
        .message-footer.show {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }
        
        .reply-btn {
            background: #047857;
            color: #ffffff;
            padding: 0.5rem 1.25rem;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .reply-btn:hover {
            background: #065f46;
            transform: translateY(-1px);
        }
        
        /* Stats Cards - Override */
        .messages-stats .card {
            cursor: default;
        }
        
        .messages-stats .card:hover {
            transform: none;
        }
        
        .messages-stats .card.clickable {
            cursor: pointer;
        }
        
        .messages-stats .card.clickable:hover {
            transform: translateY(-2px);
        }
        
        /* Bulk Actions Bar */
        .bulk-bar {
            background: #f0fdf4;
            border: 2px solid #10b981;
            padding: 1rem 1.25rem;
            border-radius: 10px;
            display: none;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.25rem;
            flex-wrap: wrap;
        }
        
        .bulk-bar.show {
            display: flex;
        }
        
        .bulk-bar strong {
            color: #047857;
            font-size: 0.9375rem;
        }
        
        .bulk-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        
        /* Empty State */
        .empty-messages {
            text-align: center;
            padding: 4rem 2rem;
            background: #ffffff;
            border-radius: 12px;
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
        }
        
        .empty-icon {
            width: 5rem;
            height: 5rem;
            margin: 0 auto 1.5rem;
            background: #f3f4f6;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #9ca3af;
        }
        
        .empty-messages h3 {
            font-size: 1.5rem;
            color: #1f2937;
            margin-bottom: 0.5rem;
        }
        
        .empty-messages p {
            color: #6b7280;
            font-size: 1rem;
            margin-bottom: 1.5rem;
        }
        
        /* Responsive */
        @media (max-width: 767px) {
            .message-header {
                grid-template-columns: auto 1fr;
                gap: 0.75rem;
            }
            
            .message-actions {
                grid-column: 2;
                margin-top: 0.5rem;
            }
            
            .sender-name,
            .sender-email {
                font-size: 0.875rem;
            }
            
            .message-subject {
                font-size: 0.875rem;
            }
            
            .message-footer {
                flex-direction: column;
                align-items: stretch;
            }
            
            .reply-btn {
                width: 100%;
                justify-content: center;
            }
        }