@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700,800,900');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.7;
    color: #c4c3ca;
    background-color: #1f2029;
    overflow-x: hidden;
    min-height: 100vh;
}

body:not(.login-page) {
    background: linear-gradient(135deg, #1f2029 0%, #0f172a 100%);
}

a {
    cursor: pointer;
    transition: all 200ms linear;
    color: #c4c3ca;
    text-decoration: none;
}

a:hover {
    color: #ffeba7;
    text-decoration: none;
}

.link {
    color: #c4c3ca;
}

.link:hover {
    color: #ffeba7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Admin Ultra-Wide Layout */
body.admin-page {
    overflow-x: hidden;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #1f2029 0%, #0f172a 100%);
}

.admin-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(255, 235, 167, 0.1);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 235, 167, 0.1);
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffeba7;
}

.sidebar-header a {
    color: #ffeba7;
    text-decoration: none;
}

.sidebar-nav {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: #c4c3ca;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 235, 167, 0.1);
    margin: 0 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    color: #ffeba7;
    opacity: 0.7;
}

.nav-item span {
    flex: 1;
}

.nav-item:hover {
    background: rgba(255, 235, 167, 0.15);
    color: #ffeba7;
    border-color: rgba(255, 235, 167, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 235, 167, 0.2);
}

.nav-item:hover i {
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 235, 167, 0.2) 0%, rgba(255, 235, 167, 0.1) 100%);
    color: #ffeba7;
    border-color: #ffeba7;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 235, 167, 0.25);
}

.nav-item.active i {
    opacity: 1;
    color: #ffeba7;
}

.nav-item-logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 235, 167, 0.1);
    padding-top: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.nav-item-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.nav-item-logout i {
    color: #fca5a5;
}

.nav-item-logout:hover i {
    color: #ef4444;
}

.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

.admin-main {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
    width: calc(100% - 280px);
}

.admin-topbar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 235, 167, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.admin-topbar-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffeba7;
    margin: 0;
}

.user-info {
    color: #c4c3ca;
    font-size: 0.9rem;
}

.admin-content-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Ultra-Wide Container for Admin */
.admin-page .admin-content-wrapper {
    max-width: 95%;
    padding: 2rem 3rem;
}

/* Ultra-Wide Tables */
.admin-page .table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    margin: 1.5rem 0;
}

.admin-page .table {
    width: 100%;
    min-width: 1600px; /* Minimum width for ultra-wide */
    font-size: 0.9rem;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-page .table th,
.admin-page .table td {
    padding: 0.875rem 1.25rem;
    white-space: nowrap;
    text-align: left;
}

.admin-page .table th {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffeba7;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 235, 167, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-page .table td {
    border-bottom: 1px solid rgba(255, 235, 167, 0.05);
}

.admin-page .table tr:hover {
    background: rgba(255, 235, 167, 0.05);
}

/* Ultra-Wide Forms */
.admin-page .form-row {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Multi-column form layouts for ultra-wide */
.admin-page .form-multi-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (min-width: 3840px) {
    .admin-page .form-multi-column {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 5760px) {
    .admin-page .form-multi-column {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 7680px) {
    .admin-page .form-multi-column {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Ultra-Wide Grids */
.admin-page .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

@media (min-width: 3840px) {
    .admin-page .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (min-width: 5760px) {
    .admin-page .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (min-width: 7680px) {
    .admin-page .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

.admin-page .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

@media (min-width: 3840px) {
    .admin-page .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (min-width: 5760px) {
    .admin-page .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

@media (min-width: 7680px) {
    .admin-page .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    }
}

/* Multi-column layout for product list */
.admin-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 3840px) {
    .admin-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    }
}

@media (min-width: 5760px) {
    .admin-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    }
}

@media (min-width: 7680px) {
    .admin-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
    }
}

/* Compact cards for ultra-wide */
.admin-page .card {
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

/* Better spacing for ultra-wide */
.admin-page .button-group {
    flex-wrap: wrap;
    gap: 1rem;
}

/* Responsive for smaller screens */
@media (max-width: 1920px) {
    .admin-page .admin-content-wrapper {
        max-width: 98%;
        padding: 2rem;
    }
}

@media (max-width: 1440px) {
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-main {
        margin-left: 240px;
        width: calc(100% - 240px);
    }
    
    .admin-page .table {
        min-width: 1200px;
    }
}

@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-main {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
    
    .admin-page .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
        width: 100%;
    }
    
    .admin-page .admin-content-wrapper {
        padding: 1rem;
    }
}

/* Header */
.top-bar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar .logo a {
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav a {
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

/* Main Content */
.main-content {
    padding: 2rem 0 4rem;
}

/* Cards */
.card {
    background: #2a2b38;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s;
    border: 1px solid rgba(255, 235, 167, 0.1);
}

.card:hover {
    box-shadow: 0 10px 15px rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.3);
    border-color: rgba(255, 235, 167, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 235, 167, 0.2);
}

.card-header h1,
.card-header h2 {
    margin: 0;
    color: #ffeba7;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffeba7;
    margin: 0 0 1rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffeba7;
    margin: 0 0 1rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #c4c3ca;
    margin: 0 0 0.75rem;
}

h4 {
    font-weight: 600;
    color: #ffeba7;
}

h6 span {
    padding: 0 20px;
    text-transform: uppercase;
    font-weight: 700;
}

p {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.7;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #c4c3ca;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid rgba(255, 235, 167, 0.2);
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
    background-color: #1f2029;
    color: #c4c3ca;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #ffeba7;
    box-shadow: 0 0 0 3px rgba(255, 235, 167, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
    opacity: 0.7;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
button,
.button,
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    background-color: #ffeba7;
    color: #102770;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    justify-content: center;
    box-shadow: 0 8px 24px 0 rgba(255,235,167,.2);
}

button:hover,
.button:hover,
.btn:hover {
    background-color: #102770;
    color: #ffeba7;
    box-shadow: 0 8px 24px 0 rgba(16,39,112,.2);
    transform: translateY(-1px);
    text-decoration: none;
}

button:active,
.button:active,
.btn:active {
    transform: translateY(0);
}

button:focus,
.button:focus,
.btn:focus {
    background-color: #102770;
    color: #ffeba7;
    box-shadow: 0 8px 24px 0 rgba(16,39,112,.2);
}

.button-secondary {
    background: #64748b;
    color: #fff;
}

.button-secondary:hover {
    background: #475569;
    color: #fff;
}

.button-primary {
    background: #3b82f6;
    color: white;
}

.button-primary:hover {
    background: #2563eb;
    color: white;
}

.button-danger {
    background: #dc2626;
    color: #fff;
}

.button-danger:hover {
    background: #b91c1c;
    color: #fff;
}

.button-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.alert-error,
.alert-error-login {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 235, 167, 0.2);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #2a2b38;
}

.table th {
    background: #1f2029;
    font-weight: 600;
    color: #ffeba7;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(255, 235, 167, 0.2);
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 235, 167, 0.1);
    color: #c4c3ca;
}

.table tr:hover {
    background: rgba(255, 235, 167, 0.05);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-yellow {
    background: #fef3c7;
    color: #92400e;
}

.badge-gray {
    background: #f1f5f9;
    color: #475569;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #2a2b38;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border-left: 4px solid #ffeba7;
}

.stat-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c4c3ca;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffeba7;
    margin: 0;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    background: #2a2b38;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    border-color: #ffeba7;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background: #ffffff;
}

.product-card h3 {
    margin: 0 0 0.5rem;
    color: #ffeba7;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffeba7;
    margin: 0.75rem 0;
}

/* Footer */
.footer {
    border-top: 1px solid rgba(255, 235, 167, 0.1);
    padding: 2rem 0;
    background: #1f2029;
    margin-top: 4rem;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #c4c3ca;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive - Mobile First Approach */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Top Bar & Navigation */
    .top-bar {
        padding: 0.75rem 0;
    }

    .top-bar .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.3);
        gap: 0.5rem;
        z-index: 1000;
    }

    .nav.mobile-open {
        display: flex;
    }

    .nav a {
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: 0.5rem;
        text-align: left;
        font-size: 0.95rem;
    }

    .top-bar .logo a {
        font-size: 1.1rem;
    }

    /* Main Content */
    .main-content {
        padding: 1.5rem 0 3rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .card-header h1,
    .card-header h2 {
        font-size: 1.25rem;
    }

    /* Product Grid */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }

    .product-card {
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .product-card img,
    .product-card .product-image-clickable {
        height: 180px;
        margin-bottom: 0.75rem;
    }

    .product-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .product-price {
        font-size: 1.25rem;
        margin: 0.5rem 0;
    }

    .product-price > div:first-child {
        font-size: 1.25rem;
    }

    .product-price > div:last-child {
        font-size: 0.85rem;
    }

    /* Product Thumbnails */
    .product-card [style*="display: flex"][style*="gap: 0.5rem"] {
        gap: 0.5rem !important;
        margin-bottom: 0.75rem;
    }

    .product-card [style*="width: 60px"][style*="height: 60px"] {
        width: 50px !important;
        height: 50px !important;
    }

    /* Buttons */
    button,
    .button,
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch target size */
        width: 100%;
        justify-content: center;
    }

    .button-small {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .button-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .button-group .button {
        width: 100%;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        padding: 0.875rem;
        font-size: 1rem; /* Prevents zoom on iOS */
        min-height: 44px; /* Touch target */
    }

    input[type="number"] {
        width: 100%;
    }

    /* Product form quantity input */
    form[method="post"][action*="cart"] {
        margin-top: 0.75rem;
    }

    form[method="post"][action*="cart"] > div {
        flex-direction: column;
        gap: 0.75rem;
    }

    form[method="post"][action*="cart"] input[type="number"] {
        width: 100%;
    }

    form[method="post"][action*="cart"] button {
        width: 100%;
    }

    /* Tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table {
        font-size: 0.85rem;
        min-width: 600px;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }

    .table th {
        font-size: 0.8rem;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    /* Lightbox */
    #imageLightbox {
        padding: 1rem;
    }

    #imageLightbox img,
    #imageLightbox iframe {
        max-width: 95vw;
        max-height: 85vh;
    }

    #closeLightbox {
        width: 44px;
        height: 44px;
        font-size: 2rem;
        top: 1rem;
        right: 1rem;
    }

    /* Notifications */
    .card[style*="border-left: 4px solid"] {
        margin-bottom: 1rem;
    }

    .card[style*="border-left: 4px solid"] .card-header h2 {
        font-size: 1rem;
    }

    /* Empty State */
    .empty-state {
        padding: 2rem 1rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
        font-size: 0.8rem;
    }

    /* Utilities */
    .text-right {
        text-align: left;
    }

    /* Product Info Sections */
    .product-card > div[style*="margin: 0.75rem 0"][style*="padding: 0.75rem"] {
        padding: 0.625rem !important;
        margin: 0.5rem 0 !important;
        font-size: 0.8rem;
    }

    .product-card > div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* SKU Display */
    .product-card > div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"] {
        flex-direction: column;
        gap: 0.25rem;
    }

    .product-card > div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"] h3 {
        margin-bottom: 0.25rem;
    }

    .product-card > div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"] span {
        margin-left: 0;
        margin-top: 0.25rem;
    }

    /* Cart & Orders */
    .table-wrapper {
        border-radius: 0.5rem;
    }

    /* Form groups in cards */
    .card .form-group {
        margin-bottom: 1rem;
    }

    /* Alerts */
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    /* Badge in notifications */
    .nav a span[style*="background: #ef4444"] {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.65rem !important;
        top: -3px !important;
        right: -3px !important;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .card {
        padding: 0.875rem;
    }

    .product-card {
        padding: 0.875rem;
    }

    .product-card img,
    .product-card .product-image-clickable {
        height: 160px;
    }

    .card-header h1,
    .card-header h2 {
        font-size: 1.1rem;
    }

    .product-card h3 {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .product-price > div:first-child {
        font-size: 1.1rem;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Login Page Styles */
.login-page {
    background-color: #1f2029;
    overflow-x: hidden;
}

.login-page .section {
    position: relative;
    width: 100%;
    display: block;
}

.login-page .full-height {
    min-height: 100vh;
}

.login-page .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

.login-page .justify-content-center {
    justify-content: center;
}

.login-page .align-self-center {
    align-self: center;
}

.login-page .py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.login-page .pt-5 {
    padding-top: 3rem;
}

.login-page .pt-sm-2 {
    padding-top: 0.5rem;
}

.login-page .pb-5 {
    padding-bottom: 3rem;
}

.login-page .text-center {
    text-align: center;
}

.login-page .mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.login-page .login-card {
    position: relative;
    width: 440px;
    max-width: 100%;
    min-height: 500px;
    margin: 60px auto 0;
    background-color: #2a2b38;
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1462889/pat.svg');
    background-position: bottom center;
    background-repeat: no-repeat;
    background-size: 300%;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: visible;
}

.login-page .form-container {
    width: 100%;
    min-height: 500px;
    position: relative;
}

.login-page .mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.login-page .center-wrap {
    position: relative;
    width: 100%;
    padding: 2rem 35px;
    z-index: 20;
    display: block;
}

.login-page .form-group {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
}

.login-page .form-style {
    padding: 13px 20px;
    padding-left: 55px;
    height: 48px;
    width: 100%;
    font-weight: 500;
    border-radius: 4px;
    font-size: 14px;
    line-height: 22px;
    letter-spacing: 0.5px;
    outline: none;
    color: #c4c3ca;
    background-color: #1f2029;
    border: none;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
    box-shadow: 0 4px 8px 0 rgba(21,21,21,.2);
}

.login-page .form-style:focus,
.login-page .form-style:active {
    border: none;
    outline: none;
    box-shadow: 0 4px 8px 0 rgba(21,21,21,.2);
}

.login-page .input-icon {
    position: absolute;
    top: 0;
    left: 18px;
    height: 48px;
    font-size: 24px;
    line-height: 48px;
    text-align: left;
    color: #ffeba7;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input:-ms-input-placeholder {
    color: #c4c3ca;
    opacity: 0.7;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input::-moz-placeholder {
    color: #c4c3ca;
    opacity: 0.7;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input:-moz-placeholder {
    color: #c4c3ca;
    opacity: 0.7;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input::-webkit-input-placeholder {
    color: #c4c3ca;
    opacity: 0.7;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input:focus:-ms-input-placeholder {
    opacity: 0;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input:focus::-moz-placeholder {
    opacity: 0;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input:focus:-moz-placeholder {
    opacity: 0;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .form-group input:focus::-webkit-input-placeholder {
    opacity: 0;
    -webkit-transition: all 200ms linear;
    transition: all 200ms linear;
}

.login-page .alert-error-login {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-page .alert-success-login {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 2px solid rgba(34, 197, 94, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-page .mb-4 {
    margin-bottom: 1.5rem;
}

.login-page .pb-3 {
    padding-bottom: 1rem;
}

.login-page .mt-4 {
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .login-page .card-3d-wrap {
        width: 100%;
        max-width: 90%;
        height: auto;
        min-height: 700px;
    }
    
    .login-page .center-wrap {
        padding: 0 20px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* Product Image Lightbox */
#imageLightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

#lightboxImage {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    background: #ffffff;
}

#lightboxPdf {
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#closeLightbox {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ffeba7;
    color: #102770;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

#closeLightbox:hover {
    background: #102770;
    color: #ffeba7;
    transform: scale(1.1);
}

.product-image-clickable {
    cursor: pointer;
    transition: transform 0.2s;
}

.product-image-clickable:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Responsive design for mobil og tablet */
@media (max-width: 1024px) {
    /* Tablet: Gør sidebar skjult som hamburger menu */
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    /* Hamburger menu knap */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: #1e293b;
        border: 1px solid rgba(255, 235, 167, 0.2);
        color: #ffeba7;
        padding: 0.5rem 0.75rem;
        border-radius: 0.25rem;
        cursor: pointer;
        font-size: 1.25rem;
        transition: all 0.2s;
    }
    
    .mobile-menu-toggle:hover {
        background: #334155;
    }
    
    /* Overlay når sidebar er åben på mobil */
    .admin-sidebar.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    .button-group {
        flex-wrap: wrap;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .card-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Mobil: Yderligere optimeringer */
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-header h1 {
        font-size: 1.25rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .button-small {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .button-group .button,
    .button-group form {
        width: 100%;
    }
    
    .button-group .button {
        text-align: center;
    }
    
    /* Skjul nogle kolonner i ordre-liste på mobil */
    .table-mobile-hide {
        display: none;
    }
    
    /* Gør formularer mere mobile-venlige */
    .form-group label {
        font-size: 0.875rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px; /* Forhindrer zoom på iOS */
        padding: 0.75rem;
    }
    
    /* Alert boxes */
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Sidebar navigation */
    .sidebar-nav a {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    /* Ekstra små skærme */
    .card-header h1 {
        font-size: 1.125rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .button {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}
