* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    padding: 40px;
}

.page {
    max-width: 1400px;
    margin: auto;
}

/* HERO */

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.hero h1 {
    font-size: 52px;
    font-weight: 700;
}

.hero p {
    font-size: 20px;
    color: #6b7280;
    margin-top: 10px;
}

/* CARDS */

.upload-card,
.products-card {
    background: white;
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 35px;
}

/* UPLOAD */

.upload-zone {
    border: 2px dashed #4f6cff;
    border-radius: 20px;
    padding: 60px 20px;
    background: #fafbff;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.upload-icon {
    font-size: 60px;
    color: #4f6cff;
    margin-bottom: 15px;
}

.upload-zone h2 {
    font-size: 34px;
    margin-bottom: 10px;
}

.upload-zone p {
    color: #6b7280;
    font-size: 18px;
    margin-bottom: 25px;
}

.selected-file {
    margin-top: 15px;
    color: #6b7280;
}

/* BUTTONS */

.choose-btn,
.upload-btn,
.download-btn,
.reset-btn {
    padding: 16px 35px;
    border-radius: 14px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.choose-btn {
    border: 2px solid #4f6cff;
    background: white;
    color: #4f6cff;
}

.choose-btn:hover {
    background: #4f6cff;
    color: white;
}

.upload-btn {
    background: #3b5cff;
    color: white;
}

.upload-btn:hover {
    background: #2447f0;
}

.download-btn {
    background: #16a34a;
    color: white;
    text-decoration: none;
}

.download-btn:hover {
    background: #12813b;
}

.reset-btn {
    background: #ef4444;
    color: white;
}

.reset-btn:hover {
    background: #dc2626;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* PRODUCTS */

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.products-header h2 {
    font-size: 32px;
}

.product-count {
    background: #eef2ff;
    color: #3b5cff;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
}

.image-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.image-card img {
    width: 100%;
    height: auto;
}

.image-label {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    word-break: break-word;
}

/* EMPTY STATE */

.empty-state {
    text-align: center;
    padding: 70px 20px;
    background: #fafafa;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
}

.empty-icon {
    font-size: 55px;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.empty-state p {
    color: #6b7280;
}

/* DATE GROUPS */

.date-wrapper {
    margin-bottom: 28px;
    border-radius: 22px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.date-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border: none;
    cursor: pointer;
    background: #eef2ff;
    color: #111827;
}

.date-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.date-title {
    font-size: 26px;
    font-weight: 800;
}

.date-subtitle {
    font-size: 14px;
    opacity: 0.7;
    margin-top: 4px;
}

.date-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.date-download {
    padding: 10px 14px;
    border-radius: 12px;
    background: #16a34a;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.date-download:hover {
    background: #12813b;
}

.date-arrow {
    font-size: 22px;
    font-weight: bold;
}

.date-content {
    display: none;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
}

/* CATEGORY GROUPS */

.category-wrapper {
    border-radius: 18px;
    overflow: hidden;
    background: white;
    border: 1px solid #e5e7eb;
}

.category-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border: none;
    cursor: pointer;
    background: #f3f4f6;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.category-count {
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3b5cff;
    font-size: 14px;
    font-weight: 700;
}

.category-products {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    padding: 18px;
}

/* MODAL */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    text-align: center;
}

.modal-content img {
    max-width: 90vw;
    max-height: 80vh;
    background: white;
    padding: 20px;
    border-radius: 20px;
}

.modal-label {
    margin-top: 15px;
    color: white;
    font-size: 22px;
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 35px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 45px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.prev-btn {
    left: 25px;
}

.next-btn {
    right: 25px;
}

/* RESPONSIVE */

@media (max-width: 700px) {
    body {
        padding: 20px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .upload-card,
    .products-card {
        padding: 24px;
    }

    .products-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .date-btn {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .date-actions {
        width: 100%;
        justify-content: space-between;
    }

    .button-row {
        flex-direction: column;
        width: 100%;
    }

    .choose-btn,
    .upload-btn,
    .download-btn,
    .reset-btn {
        width: 100%;
    }
}

/* =========================
TOP NAVIGATION
========================= */

.top-nav {

    max-width: 1400px;

    margin:
        0 auto 30px auto;

    padding:
        16px 22px;

    display: flex;

    justify-content:
        space-between;

    align-items: center;

    background: white;

    border-radius: 18px;

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.08);
}

.nav-title {

    font-size: 22px;

    font-weight: 800;
}

.nav-links {

    display: flex;

    gap: 12px;

    flex-wrap: wrap;
}

.nav-links a {

    padding:
        10px 16px;

    border-radius: 12px;

    text-decoration: none;

    color: #374151;

    font-weight: 700;

    transition: 0.2s;
}

.nav-links a:hover {

    background: #eef2ff;

    color: #3b5cff;
}

.nav-links a.active {

    background: #3b5cff;

    color: white;
}

/* =========================
LOGIN PAGE
========================= */

.login-page {

    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 20px;
}

.login-card {

    width: 100%;
    max-width: 450px;

    background: white;

    padding: 50px;

    border-radius: 28px;

    text-align: center;

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.08);
}

.login-card h1 {

    margin-top: 12px;

    font-size: 38px;
}

.login-card p {

    margin-top: 10px;

    color: #6b7280;
}

.login-form {

    margin-top: 30px;

    display: flex;
    flex-direction: column;

    gap: 18px;
}

.login-form input {

    padding: 16px;

    border-radius: 14px;

    border: 1px solid #d1d5db;

    font-size: 16px;
}

.login-form button {

    padding: 16px;

    border: none;

    border-radius: 14px;

    background: #3b5cff;

    color: white;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}

.login-form button:hover {

    background: #2447f0;
}

.logout-link {

    background: #ef4444 !important;

    color: white !important;
}

.logout-link:hover {

    background: #dc2626 !important;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.dashboard-card {
    display: block;
    padding: 30px;
    border-radius: 22px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: #111827;
    transition: 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.dashboard-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.dashboard-card h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.dashboard-card p {
    color: #6b7280;
    line-height: 1.5;
}

.dashboard-card.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.products-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-settings-btn {
    padding: 10px 16px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
    font-weight: 700;
    transition: 0.2s;
}

.app-settings-btn:hover {
    background: #e5e7eb;
}

.disabled-settings-btn {

    opacity: 0.5;

    pointer-events: none;

    cursor: not-allowed;
}

.login-error {

    margin-top: 20px;

    padding: 14px;

    border-radius: 12px;

    background: #fef2f2;

    color: #dc2626;

    font-weight: 700;
}

.image-code {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.modal-code {
    margin-top: 6px;
    font-size: 16px;
    color: #d1d5db;
}