/* =========================================
   BASE / RESET
========================================= */

html {
    box-sizing: border-box;
    font-family: "Calibri", sans-serif;
    font-size: 16px;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    min-height: 100vh;
    font: inherit;
    overflow-x: hidden;
    overflow-y: scroll;
}

/* =========================================
   TYPOGRAPHY
========================================= */

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0071c1;
}

code {
    color: #c02d76;
}

/* =========================================
   CONTENT
========================================= */

.content {
    padding-top: 1rem;
}

/* =========================================
   BUTTONS
========================================= */

.btn-primary {
    color: #fff;
    background-color: #00617f;
    border-color: #00617f;
}

    .btn-primary:hover {
        background-color: #004f66;
    }

button {
    cursor: pointer;
}

/* =========================================
   FORM / VALIDATION
========================================= */

.form-control:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 105, 255, 0.25);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #28a745;
}

.invalid {
    outline: 1px solid #dc3545;
}

.validation-message {
    color: #dc3545;
}

/* =========================================
   LOADING (DISABLED CLEAN)
========================================= */

/* Poistetaan loader glitch */
.loading-progress {
    display: none;
}

/* =========================================
   TABLES
========================================= */

.table {
    width: 100%;
}

    .table th {
        background: #e8e8e8;
        font-weight: 600;
    }

    .table td,
    .table th {
        padding: 10px;
    }

    .table tr:hover {
        background-color: #f5f5f5;
    }

.table-success {
    background-color: #d4edda !important;
}

/* =========================================
   TOPBAR / NAVBAR
========================================= */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #00617f;
    color: white;
}

    .topbar a {
        color: white;
        text-decoration: none;
        margin-left: 12px;
    }

        .topbar a:hover {
            text-decoration: underline;
        }

    .topbar .user {
        font-weight: 500;
    }

    .topbar .logout {
        margin-left: 20px;
        color: #ffcc00;
    }

/* =========================================
   CUSTOMER LIST
========================================= */

.customer-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
}

.customer-item {
    padding: 8px;
    cursor: pointer;
}

    .customer-item:hover {
        background: #f0f0f0;
    }

    .customer-item.selected {
        background: #00617f;
        color: white;
    }

/* =========================================
   MANUAL INPUT
========================================= */

.manual-toggle {
    cursor: pointer;
    color: #00617f;
}

/* =========================================
   ALERTS
========================================= */

.alert {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

/* =========================================
   TOAST
========================================= */

.toast-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #00816d;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 9999;
}

/* =========================================
   LAST ADDED
========================================= */

.last-added {
    background: #e9f7ef;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* =========================================
   MINI CART (COLLAPSIBLE)
========================================= */


.mini-cart {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-top: 2px solid var(--primary);
    z-index: 1000;
}


.mini-cart-header {
    padding: 10px;
    background: #00617f;
    color: white;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-cart-body {
    padding: 10px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* =========================================
   CART ROWS
========================================= */

.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.cart-name {
    flex: 1;
    font-size: 13px;
}

.cart-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.qty {
    width: 60px;
}

.discount {
    width: 80px;
}

/* =========================================
   CART HEADER
========================================= */

.cart-header-row {
    font-size: 12px;
    font-weight: 600;
    color: #6c6c6c;
    border-bottom: 1px solid #d1d1d1;
    margin-bottom: 4px;
}

.cart-label {
    width: 70px;
    text-align: center;
}

/* =========================================
   CART FOOTER
========================================= */

.cart-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

/* =========================================
   CARD COMPONENT
========================================= */

.card {
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    padding: 12px;
}

/* =========================================
   BLazor error UI (kept)
========================================= */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }



/* =========================================
   APP LAYOUT
========================================= */

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* =========================================
   HEADER (NAVBAR)
========================================= */

/* Logo / brand */
.brand {
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

/* Nav groups */
.nav-left,
.nav-right {
    display: flex;
    align-items: center;
}

    /* Nav links */
    .nav-right a {
        color: white;
        text-decoration: none;
        margin-left: var(--space-md);
        font-size: 14px;
    }

        .nav-right a:hover {
            text-decoration: underline;
        }

/* User name */
.user {
    margin-left: var(--space-md);
    font-weight: 500;
}

/* Logout */
.logout {
    margin-left: var(--space-lg);
    color: #ffcc00;
}

/* =========================================
   MAIN CONTENT
========================================= */


.main-content {
    flex: 1;
}


/* =========================================
   CONTAINER (CENTERED CONTENT)
========================================= */



.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}



/* =========================================
   SECTION SPACING
========================================= */

section {
    margin-bottom: var(--space-xl);
}

/* =========================================
   HEADINGS POLISH
========================================= */

h3 {
    margin-bottom: var(--space-md);
}

h4 {
    margin-bottom: var(--space-sm);
}

    /* =========================================
   PAGE RHYTHM
========================================= */

    h4 + * {
        margin-top: var(--space-xs);
    }

.table + * {
    margin-top: var(--space-md);
}


:root {
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 14px;
    --space-lg: 20px;
    --space-xl: 28px;
}


/* =========================================
   CHECKOUT LAYOUT
========================================= */

.card-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* ? key-value summary */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid #eee;
}

    .summary-row:last-child {
        border-bottom: none;
    }

/* ? totals */
.row-total {
    font-weight: 600;
}

.order-total {
    text-align: right;
    margin-top: var(--space-md);
    font-size: 16px;
}

/* ? actions */
.checkout-actions {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-lg);
}



/* =========================================
   CUSTOMER VIEW POLISH
========================================= */

/* ? search input */
.large-input {
    font-size: 15px;
    padding: 8px;
}

/* ? empty state */
.empty-state {
    padding: var(--space-md);
    color: var(--muted);
    font-style: italic;
}

/* ? manual toggle */
.small-link {
    margin-top: var(--space-sm);
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}

    .small-link:hover {
        text-decoration: underline;
    }

/* ? summary card */
.summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
}

.summary-header {
    font-size: 20px;
    color: var(--muted);
    margin-bottom: var(--space-xs);
}

.summary-content {
    font-size: 15px;
    margin-bottom: var(--space-sm);
}

/* ? address section */
.address-section {
    margin-top: var(--space-md);
}

.address-option {
    display: flex;
    gap: var(--space-sm);
    padding: 6px 0;
}

/* ? form group */
.form-group {
    margin-bottom: var(--space-md);
}


/* =========================================
   CONTENT PAGES (Terms, FAQ)
========================================= */

.content-page {
    display: flex;
    justify-content: center;
}

.content-card {
    max-width: 800px;
    width: 100%;
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* =========================================
   DASHBOARD
========================================= */

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.dashboard-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

    .dashboard-card h5 {
        margin-bottom: var(--space-sm);
    }



.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.logo-mark {
    width: 12px;
    height: 12px;
    background: white;
    display: inline-block;
    border-radius: 2px;
}



/* =========================================
   FOOTER
========================================= */


.footer {
    background: #f5f7f9;
    border-top: 1px solid var(--border);
    padding: 12px 20px;
}



.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}


.footer a {
    margin-left: var(--space-md);
    color: var(--primary);
    text-decoration: none;
}

    .footer a:hover {
        text-decoration: underline;
    }



/* =========================================
   HERO (light branding feel)
========================================= */

.hero {
    background: linear-gradient( 135deg, #00617f 0%, #00816d 100% );
    color: white;
    padding: var(--space-xl);
    border-radius: var(--radius);
    margin-bottom: var(--space-xl);
}

.hero-content h4 {
    margin-bottom: var(--space-sm);
}

/* =========================================
   DASHBOARD
========================================= */

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.dashboard-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* =========================================
   LOGIN BOX
========================================= */

.login-box {
    padding: var(--space-md);
    background: #f8f9fa;
    border-radius: var(--radius);
}



.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

/* Logo */
.logo {
    height: 35px;
    width: auto;
}

/* Teksti */
.brand-text {
    color: white;
    font-weight: 600;
    font-size: 15px;
}



/* =========================================
   TOPBAR BUTTONS
========================================= */

/* Login */
.btn-primary.small {
    padding: 6px 10px;
    font-size: 16px;
    border-radius: var(--radius);
}

/* ? Logout ghost */
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
}

    /* hover */
    .btn-ghost:hover {
        background: rgba(255,255,255,0.1);
    }

/* spacing */
.topbar .right a,
.topbar .right button {
    margin-left: var(--space-md);
}



.btn {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    border-radius: var(--radius);
    padding: 6px 10px;
}


/* Stock traffic light */
.stock-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.15);
}

.stock-red {
    background: #dc3545;
}
/* 0 */
.stock-green {
    background: #28a745;
}
/* 1 */
.stock-yellow {
    background: #ffc107;
}
/* 2 */
