/**
 * OCS POS Cloud Web Portal - Design System & Responsive Styles
 */

:root {
    --bg-main: #021524;
    --bg-sidebar: #010e18;
    --bg-card: #072238;
    --bg-card-alt: #031c30;
    --border-color: rgba(255, 125, 0, 0.22);
    --border-subtle: rgba(255, 255, 255, 0.12);
    --primary: #FF7D00;
    --primary-hover: #FF9526;
    --primary-glow: rgba(255, 125, 0, 0.25);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #38bdf8;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Navbar */
.web-navbar {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: rgba(255, 125, 0, 0.15);
    border: 1px solid var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

/* Nav Tabs */
.web-nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.web-nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.65rem 1.15rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.web-nav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.web-nav-btn.active {
    background: rgba(255, 125, 0, 0.15);
    border-color: rgba(255, 125, 0, 0.4);
    color: var(--primary);
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.kpi-icon.sales { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.kpi-icon.stock { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.kpi-icon.alert { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.kpi-icon.orders { background: rgba(255, 125, 0, 0.15); color: var(--primary); }

.kpi-val {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.2rem 0 0 0;
    color: #ffffff;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Cards & Tables */
.portal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

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

.portal-table th {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    white-space: nowrap;
}

.portal-table td {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    vertical-align: middle;
}

.portal-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Buttons */
.btn-brand {
    background: var(--primary);
    color: #021524;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-brand:hover {
    background: var(--primary-hover);
    color: #021524;
    transform: translateY(-1px);
}

.btn-secondary-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Inputs & Modals */
.portal-input {
    background: #010e18 !important;
    border: 1px solid var(--border-subtle) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 0.6rem 0.9rem !important;
    font-size: 0.9rem !important;
    outline: none !important;
}

.portal-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-glow) !important;
}

.stock-pill {
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.stock-pill.in-stock { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.stock-pill.low-stock { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.stock-pill.out-of-stock { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Quick Stock Editor In Table */
.stock-quick-editor {
    display: inline-flex;
    align-items: center;
    background: #010e18;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 2px 4px;
}

.stock-btn-step {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
}

.stock-btn-step:hover {
    color: var(--primary);
}

.stock-input-inline {
    width: 50px;
    background: transparent;
    border: none;
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    outline: none;
    font-size: 13px;
}

/* Modals */
.portal-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.portal-modal-backdrop.active {
    display: flex;
}

.portal-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    padding: 1.75rem;
}

/* Toast */
.toast-notice {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #010e18;
    border: 1px solid var(--primary);
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    font-size: 0.9rem;
}
.toast-notice.active {
    display: flex;
}
