* {
    box-sizing: border-box;
}
:root {
    /* MAIN PALETTE */
    --primary: #26577C;
    --primary-dark: #2C5745;
    --primary-medium: #457B9D;

    --blue-soft: #DCEAF1;
    --blue-soft-2: #EAF2F6;

    --teal: #44A1A4;
    --teal-bright: #24B1B1;
    --teal-soft: #DDF2F1;

    --mint: #7CD5C7;
    --mint-soft: #E6F7F4;

    --sage: #8BBB92;
    --sage-soft: #E7F1E8;

    --cream: #EBE4D1;
    --cream-soft: #F8F5EC;

    --aqua-gray: #C8DFDB;
    --stone: #A8A492;

    /* SYSTEM COLORS */
    --background: #F4F8F8;

    --surface: rgba(255, 255, 255, 0.90);
    --surface-solid: #FFFFFF;

    --border: rgba(38, 87, 124, 0.12);
    --border-strong: rgba(38, 87, 124, 0.20);

    --text: #111111;
--text-muted: #5f6368;

    --success-bg: #E7F1E8;
    --success-text: #2C5745;

    --danger-bg: #F8E9EC;
    --danger-text: #9A334D;

    --shadow:
        0 10px 30px rgba(38, 87, 124, 0.06);

    --shadow-modal:
        0 24px 70px rgba(38, 87, 124, 0.14);

    --radius: 14px;
    --radius-small: 9px;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
    color: var(--text);
}

body {
    background:
        linear-gradient(
            135deg,
            #F7FAFA 0%,
            #EEF5F5 48%,
            #F8F5EC 100%
        );
}

button,
input,
select {
    font: inherit;
}

/* =========================
   LOGIN
========================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 390px;
}

.login-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px;
    box-shadow: var(--shadow-modal);
    backdrop-filter: blur(16px);
}

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

.login-header h1 {
    margin: 0 0 6px;
    font-size: 23px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--primary-dark);
}

.login-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 650;
    color: #40526a;
}

.form-group input,
.form-group select,
.modal-card select {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    padding: 0 11px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.modal-card select:focus {
    border-color: rgba(41, 70, 105, 0.48);
    box-shadow:
        0 0 0 3px rgba(41, 70, 105, 0.07);
    background: #ffffff;
}

.form-group input[readonly] {
    background: #f6f8fb;
    color: #4f5e72;
}

.form-error {
    min-height: 18px;
    margin-bottom: 8px;
    color: var(--danger-text);
    font-size: 12px;
}

.primary-button,
.secondary-button,
.small-primary-button {
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.primary-button:active,
.secondary-button:active,
.small-primary-button:active {
    transform: translateY(1px);
}

.primary-button {
    width: 100%;
    height: 41px;
    background: var(--primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 650;
    box-shadow:
        0 5px 14px rgba(41, 70, 105, 0.12);
}

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    padding: 8px 13px;
    background: rgba(41, 70, 105, 0.07);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
}

.secondary-button:hover {
    background: rgba(41, 70, 105, 0.12);
}

.small-primary-button {
    padding: 8px 14px;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 650;
}

.small-primary-button:hover {
    background: var(--primary-dark);
}


/* =========================
   APP LAYOUT
========================= */

.app-page {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 205px;
    padding: 22px 12px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.96) 0%,
            rgba(230, 247, 244, 0.72) 100%
        );

    border-right: 1px solid rgba(38, 87, 124, 0.12);

    backdrop-filter: blur(18px);

    z-index: 50;
}

.sidebar-brand {
    margin: 2px 10px 25px;
    font-size: 16px;
    font-weight: 750;
    color: #111111;
    letter-spacing: -0.2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: block;
    padding: 9px 11px;
    border-radius: 9px;
    color: #66768c;
    text-decoration: none;
    font-size: 13px;
    font-weight: 520;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nav-link:hover {
    background: #EAF2F6;
    color: #26577C;
}

.nav-link.active {
    background:
        linear-gradient(
            90deg,
            #DCEAF1 0%,
            #E6F7F4 100%
        );

    color: #26577C;
    font-weight: 650;
}

.main-content {
    margin-left: 205px;
    padding: 24px 28px 35px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.topbar h1 {
    margin: 0 0 3px;
    font-size: 24px;
    font-weight: 720;
    letter-spacing: -0.4px;
    color: #111111;
}

.topbar p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #536278;
    font-size: 12px;
}


/* =========================
   DASHBOARD
========================= */

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.summary-card {
    min-height: 110px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 17px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.summary-label {
    display: block;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 520;
}

.summary-card strong {
    font-size: 25px;
    font-weight: 720;
    color: var(--primary-dark);
}


/* =========================
   SETTINGS
========================= */

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.section-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.table-card {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(41, 70, 105, 0.08);
    text-align: left;
    white-space: nowrap;
    font-size: 12px;
}

.data-table th {
    background: rgba(41, 70, 105, 0.025);
    color: #738096;
    font-size: 11px;
    font-weight: 650;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(41, 70, 105, 0.025);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.empty-cell {
    padding: 30px !important;
    text-align: center !important;
    color: #8c98a8;
}

.power-cell {
    color: var(--primary-dark);
    font-weight: 700;
}

.gtin-cell {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 11px !important;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 650;
}

.status-active {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-inactive {
    background: #f0f2f5;
    color: #747f8f;
}


/* =========================
   MODAL
========================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(34, 48, 67, 0.30);
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-modal);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0 0 3px;
    font-size: 17px;
    color: var(--primary-dark);
}

.modal-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(41, 70, 105, 0.07);
    color: #59697d;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.modal-card form {
    padding: 18px 19px 20px;
}

.form-row {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 5px;
}


/* =========================
   RECEIVE LENSES
========================= */

.receive-card {
    max-width: 780px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.receive-header {
    margin-bottom: 18px;
}

.receive-header h2 {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.receive-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.scan-area label {
    display: block;
    margin-bottom: 6px;
    color: #40526a;
    font-size: 12px;
    font-weight: 650;
}

.scan-area input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.scan-area input:focus {
    border-color: rgba(41, 70, 105, 0.50);
    box-shadow:
        0 0 0 3px rgba(41, 70, 105, 0.07);
}

.scan-message {
    min-height: 18px;
    margin-top: 8px;
    font-size: 11px;
}

.lens-details {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.lens-details.hidden {
    display: none;
}

.detail-item {
    min-height: 70px;
    background: rgba(248, 250, 252, 0.82);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
}

.detail-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 520;
}

.detail-item strong {
    display: block;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 680;
    overflow-wrap: anywhere;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

    .dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .lens-details {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 650px) {

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 18px;
    }

    .dashboard-grid,
    .lens-details,
    .form-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        align-items: flex-start;
    }

}

/* INLINE RECEIVING FIELDS */

.inline-brand-input,
.inline-model-input,
.inline-power-input {
    width: 100%;
    min-width: 95px;
    height: 34px;

    padding: 0 10px;

    border: 1px solid rgba(38, 87, 124, 0.18);
    border-radius: 8px;

    background: #ffffff;
    color: #111111;

    font-size: 12px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.inline-brand-input:focus,
.inline-model-input:focus,
.inline-power-input:focus {
    border-color: #457B9D;

    box-shadow:
        0 0 0 3px rgba(69, 123, 157, 0.08);

    background: #ffffff;
}

.inline-brand-input::placeholder,
.inline-model-input::placeholder,
.inline-power-input::placeholder {
    color: #9AA5B1;
    font-weight: 400;
}

.inline-power-input {
    max-width: 110px;
    font-weight: 600;
}