/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
}

body {
    width: 100%;
    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;

    color: #1f2937;

    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 0% 0%,
            rgba(37, 99, 235, 0.08),
            transparent 28%
        ),
        radial-gradient(
            circle at 100% 15%,
            rgba(59, 130, 246, 0.06),
            transparent 25%
        ),
        #f5f7fb;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}


/* =========================================================
   COLORS
========================================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --background: #f5f7fb;
    --surface: #ffffff;

    --text: #1f2937;
    --muted: #6b7280;

    --border: #e5e7eb;

    --success: #16a34a;
    --danger: #dc2626;
}


/* =========================================================
   APP
========================================================= */

.app {
    width: 100%;
    min-height: 100vh;
}


/* =========================================================
   TOP NAVIGATION
========================================================= */

.topbar {
    width: 100%;
    min-height: 72px;

    background: #ffffff;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;

    gap: 24px;

    padding: 12px 28px;

    position: sticky;
    top: 0;

    z-index: 1000;
}


/* =========================================================
   BRAND
========================================================= */

.brand {
    display: flex;
    align-items: center;

    gap: 10px;

    /*
       The brand is allowed to shrink before the
       navigation becomes uncomfortable.
    */
    flex: 0 1 auto;

    min-width: 0;

    transition: 0.2s ease;
}

.brand img {
    height: 44px;
    width: auto;

    object-fit: contain;

    flex-shrink: 1;

    transition:
        height 0.2s ease,
        width 0.2s ease;
}

.logo-icon {
    width: 40px;
    height: 40px;

    border-radius: 10px;

    background: var(--primary);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: bold;
    font-size: 20px;
}

.logo-text {
    display: flex;
    flex-direction: column;

    min-width: 0;

    transition: 0.2s ease;
}

.logo-text strong {
    font-size: 16px;

    white-space: nowrap;
}

.logo-text span {
    color: var(--muted);

    font-size: 11px;

    white-space: nowrap;
}


/* =========================================================
   NAVIGATION
========================================================= */

.navigation {
    display: flex;
    align-items: center;

    gap: 5px;

    /*
       Navigation gets the remaining space.
    */
    flex: 1 1 auto;

    min-width: 0;

    /*
       Important:
       Links themselves will never break in half.
       The navigation can shrink safely.
    */
    overflow: hidden;
}

.nav-link {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 10px 12px;

    min-height: 38px;

    border-radius: 8px;

    color: #4b5563;

    font-size: 14px;

    /*
       Never split "Customer Orders",
       "Transactions", etc.
    */
    white-space: nowrap;

    /*
       Each link remains one complete item.
    */
    flex: 0 0 auto;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.nav-link:hover {
    background: #eff6ff;

    color: var(--primary);
}

.nav-link span {
    flex-shrink: 0;
}


/* =========================================================
   ACTIVE ORDER BADGE
========================================================= */

.customer-orders-active {
    position: relative;
}

.active-order-badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 20px;
    height: 20px;

    padding: 0 6px;

    margin-left: 6px;

    border-radius: 999px;

    background: #dc2626;

    color: #ffffff;

    font-size: 11px;

    font-weight: 700;

    line-height: 1;

    vertical-align: middle;

    flex-shrink: 0;

    box-shadow:
        0 0 0 2px rgba(220, 38, 38, 0.12);
}


/* =========================================================
   USER AREA
========================================================= */

.user-area {
    display: flex;

    align-items: center;

    gap: 10px;

    /*
       User area should never get squeezed.
    */
    flex: 0 0 auto;

    min-width: max-content;
}

.user-avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: var(--primary);

    color: white;

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: bold;

    flex-shrink: 0;
}

.user-info {
    display: flex;

    flex-direction: column;

    min-width: 70px;
}

.user-info strong {
    font-size: 13px;

    white-space: nowrap;
}

.user-info span {
    color: var(--muted);

    font-size: 11px;

    white-space: nowrap;
}

.logout-link {
    color: var(--danger);

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;

    padding: 8px;

    border-radius: 6px;

    flex-shrink: 0;
}

.logout-link:hover {
    background: #fee2e2;

    border-radius: 6px;
}


/* =========================================================
   MAIN
========================================================= */

.main {
    width: 100%;

    min-height: calc(100vh - 72px);

    background:
        radial-gradient(
            circle at 15% 25%,
            rgba(37, 99, 235, 0.05),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 70%,
            rgba(59, 130, 246, 0.04),
            transparent 30%
        ),
        #f5f7fb;
}


/* =========================================================
   PAGE TITLE
========================================================= */

.page-title-bar {
    width: 100%;

    padding: 24px 28px 0;
}

.page-title-bar h1 {
    font-size: 22px;

    font-weight: 600;
}


/* =========================================================
   CONTENT
========================================================= */

.content {
    width: 100%;

    max-width: 100%;

    padding: 24px 28px 40px;

    overflow: hidden;
}


/* =========================================================
   PAGE HEADER
========================================================= */

.page-header {
    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 24px;
}

.page-header h2 {
    font-size: 20px;
}

.page-header p {
    color: var(--muted);

    margin-top: 5px;
}


/* =========================================================
   DASHBOARD STATS
========================================================= */

.stats-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 18px;

    margin-bottom: 28px;
}


/* =========================================================
   CARDS
========================================================= */

.card {
    width: 100%;

    min-width: 0;

    max-width: 100%;

    background: #ffffff;

    border: 1.5px solid #cbd5e1;

    border-radius: 12px;

    padding: 20px;

    overflow-wrap: break-word;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.06);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.card:hover {
    border-color: #94a3b8;

    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.09);
}


/* =========================================================
   STAT CARDS
========================================================= */

.stat-card {
    display: flex;

    flex-direction: column;

    gap: 8px;

    background: #ffffff;

    border: 1.5px solid #cbd5e1;

    border-radius: 12px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.06);
}

.stat-card:hover {
    border-color: #93c5fd;

    box-shadow:
        0 4px 14px rgba(37, 99, 235, 0.10);
}


/* =========================================================
   STAT TEXT
========================================================= */

.stat-label {
    color: #6b7280;

    font-size: 13px;
}

.stat-value {
    color: #1f2937;

    font-size: 28px;

    font-weight: 700;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 11px 18px;

    min-height: 42px;

    border-radius: 8px;

    border: 1px solid transparent;

    cursor: pointer;

    font-weight: 600;

    font-size: 14px;

    white-space: nowrap;

    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}


/* PRIMARY */

.btn-primary {
    background: var(--primary);

    color: white;

    border-color: #1d4ed8;
}

.btn-primary:hover {
    background: var(--primary-dark);
}


/* SUCCESS */

.btn-success {
    background: var(--success);

    color: white;

    border-color: #15803d;
}

.btn-success:hover {
    background: #15803d;
}


/* DANGER */

.btn-danger {
    background: var(--danger);

    color: white;

    border-color: #b91c1c;
}

.btn-danger:hover {
    background: #b91c1c;
}


/* SECONDARY */

.btn-secondary {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 10px 16px;

    border-radius: 8px;

    border: 1px solid var(--border);

    background: white;

    color: var(--text);

    font-weight: 600;

    font-size: 14px;
}

.btn-secondary:hover {
    background: #f9fafb;
}


/* =========================================================
   TABLES
========================================================= */

.table-container {
    width: 100%;

    max-width: 100%;

    background: white;

    border: 1px solid #dfe3e8;

    border-radius: 12px;

    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;

    text-align: left;

    border-bottom: 1px solid var(--border);
}

th {
    font-size: 12px;

    color: var(--muted);

    text-transform: uppercase;

    font-weight: 600;
}

td {
    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #f9fafb;
}


/* =========================================================
   TRANSACTION COLORS
========================================================= */

.transaction-sale {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 6px;

    background: #dcfce7;

    color: #166534;

    font-weight: 700;

    font-size: 12px;
}

.transaction-purchase {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 6px;

    background: #dbeafe;

    color: #1e40af;

    font-weight: 700;

    font-size: 12px;
}


/* =========================================================
   FORMS
========================================================= */

.form-card {
    width: 100%;

    max-width: 700px;

    background: white;

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 25px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-weight: 600;

    font-size: 14px;
}

.form-control {
    width: 100%;

    padding: 11px 12px;

    border: 1px solid var(--border);

    border-radius: 7px;

    outline: none;

    background: white;

    color: var(--text);
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 2px rgba(37, 99, 235, 0.10);
}


/* =========================================================
   ALERTS
========================================================= */

.alert {
    width: 100%;

    padding: 12px;

    border-radius: 8px;

    margin-bottom: 18px;
}


/* =========================================================
   QUICK ACTION CARDS
========================================================= */

.quick-action-card {
    display: flex;

    flex-direction: column;

    min-height: 190px;
}

.quick-action-card h3 {
    margin-bottom: 8px;
}

.quick-action-card p {
    color: var(--muted);

    line-height: 1.5;

    margin-bottom: 18px;
}

.quick-action-card .btn {
    align-self: flex-start;

    margin-top: auto;
}


/* =========================================================
   TRANSACTION FILTERS
========================================================= */

.transaction-filter-card {
    margin-bottom: 20px;
}

.transaction-filter {
    display: flex;

    align-items: flex-end;

    gap: 16px;

    flex-wrap: wrap;
}

.filter-group {
    min-width: 180px;
}

.filter-group label {
    display: block;

    margin-bottom: 7px;

    font-size: 13px;

    font-weight: 600;

    color: var(--text);
}

.transaction-filter .form-control {
    width: auto;

    min-width: 180px;
}

.filter-buttons {
    display: flex;

    gap: 10px;
}


/* =========================================================
   LOGIN
========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background: var(--background);
}

.login-card {
    width: 100%;

    max-width: 420px;

    background: white;

    padding: 35px;

    border-radius: 15px;

    border: 1px solid var(--border);

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.05);
}

.login-logo {
    text-align: center;

    margin-bottom: 30px;
}

.login-logo h1 {
    margin-top: 12px;

    font-size: 24px;
}

.login-logo p {
    color: var(--muted);

    margin-top: 5px;
}

.login-card input {
    width: 100%;

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 8px;

    margin-top: 7px;
}

.login-card button {
    width: 100%;

    margin-top: 10px;
}

.error-message {
    background: #fee2e2;

    color: #991b1b;

    padding: 12px;

    border-radius: 8px;

    margin-bottom: 18px;
}


/* =========================================================
   TABLET / MEDIUM SCREENS
========================================================= */

@media (max-width: 1250px) {

    .topbar {
        gap: 16px;

        padding-left: 18px;
        padding-right: 18px;
    }

    /*
       FIRST COMPRESSION:
       Make the GNT branding slightly smaller.
    */

    .brand {
        gap: 7px;
    }

    .brand img {
        height: 38px;
    }

    .logo-text strong {
        font-size: 14px;
    }

    .logo-text span {
        font-size: 10px;
    }

    .navigation {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 9px;

        font-size: 13px;
    }

    .content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   COMPACT BRAND
========================================================= */

@media (max-width: 1050px) {

    .topbar {
        gap: 10px;
    }

    /*
       SECOND COMPRESSION:
       Keep the logo but reduce its footprint.
    */

    .brand {
        gap: 5px;
    }

    .brand img {
        height: 34px;
    }

    .logo-text strong {
        font-size: 13px;
    }

    /*
       Hide only the tagline.
       GNT Partners name remains visible.
    */

    .logo-text span {
        display: none;
    }

    .navigation {
        gap: 1px;
    }

    .nav-link {
        padding: 7px 8px;

        font-size: 12px;

        gap: 5px;
    }

    .user-area {
        gap: 6px;
    }

    .logout-link {
        padding: 6px;

        font-size: 12px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .topbar {
        min-height: auto;

        padding: 12px 14px;

        /*
           On mobile:
           Brand + user area stay on first row.
           Navigation moves to second row.
        */

        flex-wrap: wrap;

        gap: 10px;
    }

    .brand {
        flex: 1;

        min-width: 0;

        gap: 6px;
    }

    .brand img {
        height: 36px;
    }

    /*
       On mobile we only need the logo.
    */

    .logo-text {
        display: none;
    }

    .user-area {
        margin-left: auto;

        flex-shrink: 0;
    }

    .user-info {
        display: none;
    }

    .logout-link {
        display: inline-block;

        padding: 8px 10px;

        font-size: 13px;

        white-space: nowrap;
    }

    /*
       Navigation gets its own row.
    */

    .navigation {
        order: 3;

        flex-basis: 100%;

        width: 100%;

        display: flex;

        overflow-x: auto;

        overflow-y: hidden;

        gap: 4px;

        padding-bottom: 5px;

        scrollbar-width: thin;

        -webkit-overflow-scrolling: touch;
    }

    .navigation::-webkit-scrollbar {
        height: 4px;
    }

    .navigation::-webkit-scrollbar-track {
        background: transparent;
    }

    .navigation::-webkit-scrollbar-thumb {
        background: #cbd5e1;

        border-radius: 999px;
    }

    /*
       Each navigation item remains complete.
       User can scroll horizontally if necessary.
    */

    .nav-link {
        flex-shrink: 0;

        padding: 9px 11px;

        font-size: 13px;
    }

    .page-title-bar {
        padding: 20px 16px 0;
    }

    .content {
        padding: 20px 16px 30px;
    }

    .stats-grid {
        grid-template-columns: 1fr;

        gap: 15px;
    }

    .card {
        width: 100%;

        padding: 18px;
    }

    .page-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 10px;
    }

    .transaction-filter {
        flex-direction: column;

        align-items: stretch;
    }

    .filter-group {
        width: 100%;

        min-width: 0;
    }

    .transaction-filter .form-control {
        width: 100%;

        min-width: 0;
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-buttons .btn,
    .filter-buttons .btn-secondary {
        flex: 1;
    }

    .quick-action-card {
        min-height: 175px;
    }
}


/* =========================================================
   SMALL SCREENS
========================================================= */

@media (max-width: 600px) {

    .content {
        padding-left: 12px;

        padding-right: 12px;
    }

    .page-title-bar {
        padding-left: 12px;

        padding-right: 12px;
    }

    .card {
        padding: 16px;
    }

    .btn {
        min-height: 44px;

        padding: 11px 16px;
    }

    th,
    td {
        padding: 11px 12px;
    }
}


/* =========================================================
   PAYMENT STATUS
========================================================= */

.payment-paid {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 6px;

    background: #dcfce7;

    color: #166534;

    font-size: 12px;

    font-weight: 700;
}

.payment-credit {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 6px;

    background: #fef3c7;

    color: #92400e;

    font-size: 12px;

    font-weight: 700;
}


/* =========================================================
   TRANSACTION TABLE
========================================================= */

.transaction-filter-card {
    margin-bottom: 20px;
}

.transaction-filter {
    display: flex;

    align-items: flex-end;

    gap: 16px;

    flex-wrap: wrap;
}

.filter-group {
    min-width: 180px;
}

.filter-buttons {
    display: flex;

    gap: 10px;
}


/* =========================================================
   MOBILE TRANSACTIONS
========================================================= */

@media (max-width: 768px) {

    .transaction-filter {
        flex-direction: column;

        align-items: stretch;
    }

    .filter-group {
        width: 100%;

        min-width: 0;
    }

    .transaction-filter .form-control {
        width: 100%;
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-buttons .btn {
        flex: 1;
    }
}


/* =========================================================
   CREDIT PAGES
========================================================= */

.credit-page-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.credit-page-header h2 {
    font-size: 20px;
}

.credit-page-header p {
    color: var(--muted);

    margin-top: 5px;
}

.credit-filter-buttons {
    display: flex;

    gap: 8px;

    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 12px;

    min-height: 36px;

    font-size: 13px;
}

.credit-cleared-text {
    color: #166534;

    font-weight: 600;

    font-size: 13px;
}


/* =========================================================
   CREDIT TABLE
========================================================= */

.credit-page-header + .table-container {
    border: 1.5px solid #cbd5e1;
}


/* =========================================================
   CREDIT MOBILE
========================================================= */

@media (max-width: 768px) {

    .credit-page-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .credit-filter-buttons {
        width: 100%;
    }

    .credit-filter-buttons .btn {
        flex: 1;

        text-align: center;
    }
}


/* =========================================================
   CREDIT MANAGEMENT
========================================================= */

.credit-stat-card {
    border: 2px solid #d6e3f5;

    background: #ffffff;

    box-shadow:
        0 3px 10px rgba(37, 99, 235, 0.08);
}

.credit-paid {
    color: #16a34a;
}

.credit-outstanding {
    color: #dc2626;
}

.credit-amount {
    font-weight: 700;

    color: #dc2626;
}

.credit-status {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 7px;

    font-size: 12px;

    font-weight: 700;
}

.credit-pending {
    background: #fef3c7;

    color: #92400e;

    border: 1px solid #f59e0b;
}

.credit-cleared {
    background: #dcfce7;

    color: #166534;

    border: 1px solid #22c55e;
}

.credit-complete {
    color: #16a34a;

    font-weight: 700;

    font-size: 13px;
}

.btn-small {
    padding: 8px 12px;

    min-height: 36px;

    font-size: 12px;
}

.credit-payment-wrapper {
    width: 100%;

    display: flex;

    justify-content: center;
}

.credit-payment-card {
    width: 100%;

    max-width: 750px;

    border: 2px solid #d6e3f5;

    box-shadow:
        0 5px 18px rgba(37, 99, 235, 0.10);
}

.credit-summary {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 25px;
}

.credit-summary > div {
    padding: 15px;

    background: #f8fbff;

    border: 1px solid #cbdcf2;

    border-radius: 9px;
}

.credit-summary span {
    display: block;

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 5px;
}

.credit-summary strong {
    font-size: 16px;
}

.payment-actions {
    display: flex;

    gap: 10px;

    margin-top: 20px;
}

.payment-actions .btn {
    min-width: 140px;
}

.credit-payment-card form p {
    margin-bottom: 18px;
}

.credit-payment-card form label {
    display: block;

    margin-bottom: 7px;

    font-weight: 600;

    font-size: 14px;
}

.credit-payment-card form input,
.credit-payment-card form select,
.credit-payment-card form textarea {
    width: 100%;

    padding: 11px 12px;

    border: 1px solid #cbd5e1;

    border-radius: 8px;

    background: #ffffff;

    outline: none;
}

.credit-payment-card form input:focus,
.credit-payment-card form select:focus,
.credit-payment-card form textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* =========================================================
   CREDIT PAYMENT MOBILE
========================================================= */

@media (max-width: 768px) {

    .credit-summary {
        grid-template-columns: 1fr;
    }

    .payment-actions {
        flex-direction: column;
    }

    .payment-actions .btn {
        width: 100%;
    }

    .btn-small {
        white-space: nowrap;
    }
}


/* =========================================================
   CREDIT PAYMENT HISTORY
========================================================= */

.credit-payment-history {
    margin-top: 8px;
}

.credit-payment-history summary {
    cursor: pointer;

    list-style: none;

    display: inline-block;
}

.credit-payment-history summary::-webkit-details-marker {
    display: none;
}

.payment-history-box {
    margin-top: 15px;

    padding: 15px;

    border-radius: 8px;

    background: #f8f9fa;

    min-width: 500px;
}

.payment-history-box h4 {
    margin-top: 0;

    margin-bottom: 12px;
}

.payment-history-box table {
    width: 100%;

    border-collapse: collapse;
}

.payment-history-box th,
.payment-history-box td {
    padding: 8px;

    text-align: left;

    border-bottom: 1px solid #ddd;
}

.payment-history-summary {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    margin-top: 15px;

    padding-top: 12px;

    border-top: 1px solid #ddd;
}

.credit-paid {
    color: #198754;
}

.credit-outstanding {
    color: #dc3545;
}


/* =========================================================
   SITE FOOTER
========================================================= */

.site-footer {
    margin-top: 60px;

    padding: 40px 20px 20px;

    background: #111827;

    color: #d1d5db;

    text-align: center;
}

.footer-content {
    max-width: 700px;

    margin: 0 auto;
}

.footer-content h3 {
    color: white;

    font-size: 20px;

    margin-bottom: 10px;
}

.footer-content p {
    font-size: 14px;

    line-height: 1.6;
}

.footer-links {
    display: flex;

    justify-content: center;

    gap: 20px;

    flex-wrap: wrap;

    margin-top: 20px;
}

.footer-links a {
    color: #d1d5db;

    text-decoration: none;

    font-size: 14px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    max-width: 700px;

    margin: 30px auto 0;

    padding-top: 15px;

    border-top: 1px solid #374151;

    font-size: 13px;

    color: #9ca3af;
}


/* =====================================================
   CUSTOMER PORTAL
===================================================== */

.customer-page {
    width: 100%;
}

.customer-hero {
    display: flex;

    justify-content: space-between;

    gap: 24px;

    align-items: center;

    padding: 28px;

    margin-bottom: 22px;

    background:
        linear-gradient(
            135deg,
            #eff6ff,
            #ffffff
        );

    border: 1px solid #dbeafe;

    border-radius: 16px;
}

.customer-eyebrow {
    color: #2563eb;

    font-size: 12px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .08em;
}

.customer-hero h2 {
    margin: 7px 0;

    font-size: 30px;
}

.customer-hero p {
    margin: 0;

    color: #64748b;
}

.customer-stats {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 28px;

    max-width: 520px;
}

.customer-stat {
    background: #fff;

    border: 1px solid #e2e8f0;

    border-radius: 12px;

    padding: 18px;

    box-shadow:
        0 4px 15px rgba(15, 23, 42, .05);
}

.customer-stat span {
    display: block;

    color: #64748b;

    font-size: 13px;

    margin-bottom: 5px;
}

.customer-stat strong {
    font-size: 25px;
}

.customer-section-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin: 28px 0 14px;
}

.customer-section-header h2,
.customer-section-header h3 {
    margin: 0 0 5px;
}

.customer-section-header p {
    margin: 0;

    color: #64748b;

    font-size: 13px;
}

.customer-product-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.customer-product-card {
    background: #fff;

    border: 1px solid #e2e8f0;

    border-radius: 14px;

    padding: 19px;

    box-shadow:
        0 4px 15px rgba(15, 23, 42, .04);
}

.customer-product-top {
    display: flex;

    justify-content: flex-end;

    min-height: 25px;
}

.customer-product-card h4 {
    margin: 10px 0 5px;

    font-size: 18px;
}

.product-meta {
    color: #64748b;

    margin: 3px 0;

    font-size: 13px;
}

.customer-stock {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 700;
}

.customer-stock.in-stock {
    background: #dcfce7;

    color: #166534;
}

.customer-stock.out-stock {
    background: #fee2e2;

    color: #991b1b;
}

.customer-product-price {
    margin: 17px 0;

    font-size: 23px;

    font-weight: 800;
}

.customer-product-price small {
    font-size: 12px;

    color: #64748b;

    font-weight: 600;
}

.customer-order-form {
    display: grid;

    grid-template-columns: 90px 1fr;

    gap: 8px;

    align-items: center;
}

.customer-search {
    display: flex;

    gap: 10px;

    max-width: 720px;

    margin-bottom: 20px;
}

.customer-table-wrap {
    overflow-x: auto;

    background: #fff;

    border: 1px solid #e2e8f0;

    border-radius: 12px;
}

.customer-table {
    width: 100%;

    border-collapse: collapse;

    min-width: 720px;
}

.customer-table th,
.customer-table td {
    padding: 13px 15px;

    text-align: left;

    border-bottom: 1px solid #eef2f7;
}

.customer-table th {
    background: #f8fafc;

    font-size: 12px;

    color: #475569;

    text-transform: uppercase;

    letter-spacing: .04em;
}

.customer-table td {
    font-size: 14px;
}

.customer-table tr:last-child td {
    border-bottom: 0;
}

.customer-table a {
    color: #2563eb;

    text-decoration: none;

    font-weight: 600;
}

.order-status {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 700;
}

.status-pending {
    background: #fef3c7;

    color: #92400e;
}

.status-accepted,
.status-processing {
    background: #dbeafe;

    color: #1e40af;
}

.status-ready {
    background: #e0e7ff;

    color: #3730a3;
}

.status-completed {
    background: #dcfce7;

    color: #166534;
}

.status-rejected,
.status-cancelled {
    background: #fee2e2;

    color: #991b1b;
}

.empty-state {
    padding: 40px;

    text-align: center;

    background: #fff;

    border: 1px dashed #cbd5e1;

    border-radius: 12px;

    grid-column: 1 / -1;
}

.empty-cell {
    text-align: center !important;

    color: #64748b;

    padding: 30px !important;
}

.customer-checkout-bar {
    display: flex;

    justify-content: flex-end;

    align-items: center;

    gap: 25px;

    padding: 20px 0;

    font-size: 18px;
}

.inline-quantity-form {
    display: flex;

    gap: 7px;

    align-items: center;

    max-width: 180px;
}

.inline-quantity-form .form-control {
    width: 75px;
}

.checkout-layout {
    display: grid;

    grid-template-columns:
        1.3fr 1fr;

    gap: 20px;
}

.checkout-card {
    padding: 22px;
}

.checkout-card h2 {
    margin-top: 0;
}

.checkout-total {
    display: flex;

    justify-content: flex-end;

    padding: 18px 0;

    font-size: 20px;

    font-weight: 800;
}

.form-help {
    color: #64748b;

    font-size: 13px;

    line-height: 1.6;
}

.field-error {
    color: #dc2626;

    font-size: 12px;

    margin-top: 5px;
}

.order-notes {
    margin-top: 20px;

    padding: 16px;

    background: #f8fafc;

    border-radius: 10px;
}

.order-notes p {
    margin: 6px 0 0;

    color: #475569;
}

.danger-action {
    margin-top: 18px;
}

.order-management-head {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-bottom: 20px;
}

.order-management-head h2 {
    margin: 0 0 5px;
}

.order-management-head p {
    margin: 0;

    color: #64748b;
}

.order-management-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 20px;

    margin-top: 20px;
}

.order-management-grid .card {
    padding: 22px;
}

.order-management-grid h3 {
    margin-top: 0;
}


/* =========================================================
   CUSTOMER RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .customer-product-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .checkout-layout,
    .order-management-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

    .customer-hero,
    .customer-section-header,
    .order-management-head {
        flex-direction: column;

        align-items: flex-start;
    }

    .customer-product-grid {
        grid-template-columns: 1fr;
    }

    .customer-stats {
        grid-template-columns: 1fr;

        max-width: none;
    }

    .customer-search {
        flex-direction: column;
    }

    .customer-order-form {
        grid-template-columns: 1fr;
    }

    .customer-checkout-bar {
        flex-direction: column;

        align-items: stretch;
    }
}


/* =========================================================
   LOGIN / REGISTER
========================================================= */

.login-register-link {
    margin-top: 18px;

    text-align: center;

    font-size: 13px;

    color: #64748b;
}

.login-register-link a {
    color: #2563eb;

    font-weight: 700;

    text-decoration: none;

    margin-left: 4px;
}

.register-card {
    max-width: 520px;
}
/* =========================================================
   OWNER QUICK ACTION CARDS
========================================================= */

.quick-actions-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    min-height: 190px;

    padding: 22px;

    background: #ffffff;

    border: 1.5px solid #cbd5e1;

    border-radius: 12px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.06);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.quick-actions-card:hover {
    transform: translateY(-2px);

    border-color: #93c5fd;

    box-shadow:
        0 6px 16px rgba(37, 99, 235, 0.10);
}

.quick-actions-card h3 {
    margin: 0 0 8px;

    font-size: 17px;

    color: #1f2937;
}

.quick-actions-card p {
    margin: 0 0 20px;

    color: #6b7280;

    font-size: 14px;

    line-height: 1.5;
}

.quick-actions-card .btn {
    align-self: flex-start;
}


/* =========================================================
   PROFORMA & PAYMENT ACTIONS
========================================================= */

.proforma-action {
    border-color: #bfdbfe;
}

.payment-action {
    border-color: #bfdbfe;
}


/* =========================================================
   OWNER QUICK ACTIONS RESPONSIVE
========================================================= */

@media (max-width: 768px) {

    .quick-actions-card {
        min-height: auto;
    }

    .quick-actions-card .btn {
        width: 100%;
    }
}


/* =========================================================
   SLIDE-IN NAVIGATION DRAWER
   (activated by JS when links don't fit, or on phones)
========================================================= */

.nav-toggle,
.nav-close,
.nav-backdrop {
    display: none;
}

.nav-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
}

.topbar.nav-collapsed .nav-toggle {
    display: flex;
}

.topbar.nav-collapsed .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1;
}

.topbar.nav-collapsed .nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.topbar.nav-collapsed .navigation {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    height: 100vh;
    order: 0;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 64px 14px 24px;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    z-index: 2;
}

.topbar.nav-collapsed .navigation.open {
    transform: translateX(0);
}

.topbar.nav-collapsed .nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.topbar.nav-collapsed .nav-link {
    justify-content: flex-start;
    width: 100%;
    padding: 13px 14px;
    font-size: 15px;
    gap: 10px;
}

/* keep brand + hamburger + user area on ONE row */
.topbar.nav-collapsed {
    flex-wrap: nowrap;
}

.topbar.nav-collapsed .brand {
    flex: 1 1 auto;
}

body.nav-open {
    overflow: hidden;
}
