/* ================= ROOT ================= */
:root {
    --primary: #0d6efd;
    --primary-light: #3da5ff;

    --bg-dark: #070a10;
    --bg-soft: #0b0f14;

    --text-main: #e6ebf2;
    --text-muted: #9aa4b2;

    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.10);

    --glass-soft: rgba(255, 255, 255, 0.05);
    --glass-border-soft: rgba(255, 255, 255, 0.08);

    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(13, 110, 253, 0.35);

    --navbar-height: 60px;
    --sidebar-width: 250px;
}

/* ================= GLOBAL ================= */
body {
    background: radial-gradient(circle at top, #0b0f14, #05070d);
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--text-main);
}

/* glow bg */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.06), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* ================= NAVBAR ================= */
.navbar-glass {
    height: var(--navbar-height);
    background: rgba(10, 12, 18, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1200;
}

/* ================= FOOTER ================= */
footer {
    margin-left: var(--sidebar-width);
    background: rgba(10, 12, 18, 0.75);
    backdrop-filter: blur(16px);
}

/* ================= UNIVERSAL CARD ================= */
.u-card {
    position: relative;
    padding: 18px;
    border-radius: 16px;

    background: var(--glass-soft);
    border: 1px solid var(--glass-border-soft);

    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);

    transition: all 0.25s ease;
    overflow: hidden;
}

.u-card:hover {
    transform: translateY(-6px);
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 20px 60px rgba(13, 110, 253, 0.15);
}

.u-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: var(--u-color, #0d6efd);
}

.u-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.u-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.06);
    color: var(--u-color, #0d6efd);
}

.u-card-title {
    font-size: 13px;
    color: var(--text-muted);
}

.u-card-value {
    font-size: 22px;
    font-weight: 700;
}

.u-card-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* colors */
.u-primary {
    --u-color: #0d6efd;
}

.u-success {
    --u-color: #28c76f;
}

.u-danger {
    --u-color: #ea5455;
}

.u-warning {
    --u-color: #ff9f43;
}

/* ================= TABLE ================= */
.u-table {
    width: 100%;
}

.u-table thead th {
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.u-table tbody tr:hover {
    background: rgba(13, 110, 253, 0.06);
}

.u-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ================= BADGE ================= */
.u-badge {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
}

.u-badge-success {
    background: rgba(40, 199, 111, 0.15);
    color: #28c76f;
}

.u-badge-danger {
    background: rgba(234, 84, 85, 0.15);
    color: #ea5455;
}

.u-badge-warning {
    background: rgba(255, 159, 67, 0.15);
    color: #ff9f43;
}

.u-badge-primary {
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
}

/* ================= FORM ================= */
.u-form-control {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    border-radius: 12px;
    padding: 10px;
}

.u-form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(13, 110, 253, 0.35);
}

/* ================= BUTTON ================= */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00c6ff);
    border: none;
}

/* ================= PAGE HEADER ================= */
.u-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 18px;
    margin-bottom: 20px;

    border-radius: 16px;
    background: var(--glass-soft);
    border: 1px solid var(--glass-border-soft);
}

.u-page-title {
    font-size: 18px;
    font-weight: 600;
}

.u-page-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ================= GLASS TABS ================= */

.u-tabs {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 6px;

    display: inline-flex;
    gap: 6px;

    backdrop-filter: blur(16px);
}

.u-tab-link {
    border: none !important;
    background: transparent !important;

    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;

    padding: 10px 16px;
    border-radius: 10px;

    transition: 0.25s ease;
}

.u-tab-link:hover {
    background: rgba(13, 110, 253, 0.10);
    color: #fff;
}

.u-tab-link.active {
    background: linear-gradient(135deg,
            rgba(13, 110, 253, 0.35),
            rgba(13, 110, 253, 0.10));

    color: #fff;

    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.15);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
    .content-wrapper,
    footer {
        margin-left: 0;
    }
}
/* ================= ERP EXTENSIONS ================= */

/* Layout shell used by new templates */
.sidebar-body { margin: 0; }
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    background: rgba(10, 12, 18, 0.85);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border-soft);
    overflow-y: auto;
    z-index: 1200;
    transition: transform 0.25s ease;
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 16px; border-bottom: 1px solid var(--glass-border-soft);
}
.sidebar-brand { color: var(--text-main); text-decoration: none; font-weight: 700; font-size: 1.1rem; display:flex; align-items:center; }
.sidebar-toggle { color: var(--text-muted); background: transparent; border: none; }
.sidebar-branch { border-bottom: 1px solid var(--glass-border-soft); }
.sidebar-nav { list-style: none; padding: 10px 0; margin: 0; }
.nav-heading { padding: 14px 18px 6px; font-size: 0.7rem; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: var(--text-muted); font-size: 0.88rem; border-left: 3px solid transparent; transition: all 0.15s ease; }
.sidebar-nav .nav-link:hover { background: var(--glass-soft); color: var(--text-main); }
.sidebar-nav .nav-link.active { background: rgba(13,110,253,0.12); color: var(--primary-light); border-left-color: var(--primary); }
.sidebar-nav .nav-link i { width: 18px; text-align: center; }

.main-content { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: rgba(10,12,18,0.7); backdrop-filter: blur(12px); border-bottom: 1px solid var(--glass-border-soft); padding: 10px 0; position: sticky; top: 0; z-index: 1100; }
.content-wrapper { padding: 24px; flex: 1; }

.page-header { margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--glass-border-soft); }

.glass-card, .card { background: var(--glass-bg); border: 1px solid var(--glass-border-soft); border-radius: 14px; backdrop-filter: blur(10px); }
.card-header { background: transparent; border-bottom: 1px solid var(--glass-border-soft); }
.card-footer { background: transparent; border-top: 1px solid var(--glass-border-soft); }

.table { color: var(--text-main); }
.table > :not(caption) > * > * { border-bottom-color: var(--glass-border-soft); background: transparent; }
.table-hover > tbody > tr:hover > * { background: rgba(255,255,255,0.04); color: var(--text-main); }

.kpi-card { display: flex; align-items: center; gap: 14px; background: var(--glass-bg); border: 1px solid var(--glass-border-soft); border-radius: 14px; padding: 18px; }
.kpi-icon { width: 48px; height: 48px; min-width:48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.kpi-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.kpi-success .kpi-icon { background: rgba(25,135,84,0.18); color: #2ecc71; }
.kpi-primary .kpi-icon { background: rgba(13,110,253,0.18); color: var(--primary-light); }
.kpi-warning .kpi-icon { background: rgba(255,193,7,0.18); color: #ffc107; }
.kpi-danger  .kpi-icon { background: rgba(220,53,69,0.18); color: #ff6b6b; }
.kpi-info    .kpi-icon { background: rgba(13,202,240,0.18); color: #4fd1c5; }
.kpi-secondary .kpi-icon { background: rgba(108,117,125,0.18); color: #adb5bd; }

.avatar-initials, .avatar-lg { background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.avatar-initials { width: 28px; height: 28px; font-size: 0.75rem; }
.avatar-lg { width: 90px; height: 90px; font-size: 1.6rem; margin: 0 auto; }

.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at top, #0b0f14, #05070d); }
.auth-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.auth-card { background: var(--glass-bg); border: 1px solid var(--glass-border-soft); border-radius: 18px; padding: 2.5rem; backdrop-filter: blur(16px); box-shadow: var(--shadow-soft); }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo i { font-size: 2.5rem; color: var(--primary-light); }

.btn-xs { padding: 0.15rem 0.5rem; font-size: 0.75rem; border-radius: 6px; }

.bg-purple { background-color: #6f42c1 !important; }
.text-purple { color: #6f42c1 !important; }

.status-delivered { background-color: #198754; }
.status-in_progress { background-color: #ffc107; color: #000; }
.status-ready { background-color: #0dcaf0; color:#000; }
.status-cancelled { background-color: #6c757d; }
.status-quality_check { background-color: #6f42c1; }
.status-draft, .status-checked_in, .status-inspection, .status-estimated, .status-customer_approved { background-color: #0d6efd; }

.notification-dropdown .dropdown-header { display:flex; }
.dropdown-footer { padding: 8px; text-align:center; border-top:1px solid var(--glass-border-soft); }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1150;
}
@media (max-width: 991px) {
    .sidebar-backdrop.show { display: block; }
}

/* ================= CUSTOMER PORTAL ================= */
.portal-body {
    background: radial-gradient(circle at top, #0b0f14, #05070d);
    min-height: 100vh;
}
.portal-navbar {
    background: rgba(10, 12, 18, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border-soft);
}
.portal-stat-card { text-align: center; }
.portal-stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.portal-stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ================= UTILITIES (replace one-off inline styles) ================= */
.w-80px  { width: 80px; }
.w-90px  { width: 90px; }
.w-100px { width: 100px; }
.w-140px { width: 140px; }
.w-160px { width: 160px; }
.w-180px { width: 180px; }
.w-200px { width: 200px; }
.truncate-120 { max-width: 120px; }
.truncate-140 { max-width: 140px; }
.truncate-150 { max-width: 150px; }
.truncate-200 { max-width: 200px; }
.icon-circle-42 { width: 42px; height: 42px; }
.icon-circle-44 { width: 44px; height: 44px; }
.img-cover { object-fit: cover; }
.fs-tiny { font-size: 0.6rem; }
.fs-xs { font-size: 0.7rem; }
.fs-icon-lg { font-size: 3rem; }
.notification-dropdown { width: 320px; max-height: 400px; overflow-y: auto; }
.thumb-80 { height: 80px; width: 100%; object-fit: cover; }
.notif-preview { font-size: 0.75rem; }
.search-select-box { z-index: 1500; }
.minw-100px { min-width: 100px; }
.minw-110px { min-width: 110px; }
