/* ============================================================
   FieldOps Platform — Global Styles
   ============================================================ */

/* ============================================================
   Role badge colours — explicit hex, not Bootstrap opacity
   ============================================================ */
.badge-super-admin  { background-color: #a10000 !important; color: #fff !important; }   /* deep red   — GAG internal */
.badge-admin        { background-color: #dc3545 !important; color: #fff !important; }   /* red        — full access */
.badge-sales-mgr    { background-color: #0d6efd !important; color: #fff !important; }   /* blue       — sales lead */
.badge-ops-mgr      { background-color: #157347 !important; color: #fff !important; }   /* dark green — ops lead */
.badge-inv-mgr      { background-color: #d97706 !important; color: #fff !important; }   /* amber      — inventory lead */
.badge-acc-mgr      { background-color: #0891b2 !important; color: #fff !important; }   /* teal       — accounts lead */
.badge-sales-user   { background-color: #6ea8fe !important; color: #031633 !important; }/* light blue */
.badge-ops-user     { background-color: #75b798 !important; color: #0a3622 !important; }/* light green */
.badge-inv-user     { background-color: #fcd34d !important; color: #451a03 !important; }/* light amber */
.badge-acc-user     { background-color: #67e8f9 !important; color: #083344 !important; }/* light teal */
.badge-all-user     { background-color: #6f42c1 !important; color: #fff !important; }   /* purple     — all access */
.badge-technician   { background-color: #6c757d !important; color: #fff !important; }   /* grey       — mobile only */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    overflow: hidden;
}

/* ============================================================
   App Shell Layout
   ============================================================ */
.app-shell {
    height: 100vh;
    overflow: hidden;
}

/* ============================================================
   Sidebar
   ============================================================ */
.app-sidebar {
    width: 240px;
    min-height: 100vh;
    background: #1a2035;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    flex-shrink: 0;
    overflow: hidden;
}

.app-sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 56px;
}

.brand-name {
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 2px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}

.sidebar-nav .nav-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-nav .nav-item.active {
    background: rgba(13,110,253,0.25);
    color: #4f9ff8;
    font-weight: 600;
}

.nav-section-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 0.75rem 0.25rem;
    font-size: 0.675rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: color 0.15s;
    text-align: left;
}

.nav-section-toggle:hover {
    color: rgba(255,255,255,0.6);
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
}

/* ============================================================
   Top Header
   ============================================================ */
.app-header {
    min-height: 56px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

/* ============================================================
   Main content area
   ============================================================ */
.app-content {
    min-width: 0;
}

.app-main {
    background: #f5f7fa;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-shell {
    overflow: hidden;
}

.login-brand {
    width: 420px;
    flex-shrink: 0;
    background: linear-gradient(145deg, #1a2035 0%, #0d6efd 100%);
}

.login-form-panel {
    background: #f5f7fa;
}

.login-card {
    border-radius: 16px !important;
}

/* ============================================================
   Cards and utilities
   ============================================================ */
.card {
    border-radius: 12px;
}

.icon-box {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================
   Table row / detail links
   ============================================================ */
.row-link {
    color: #3b5bdb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.row-link:hover {
    color: #2244c7;
    text-decoration: underline;
}
.row-link-muted {
    color: #6c757d;
    text-decoration: none;
}
.row-link-muted:hover {
    color: #3b5bdb;
    text-decoration: underline;
}

/* ============================================================
   Validation and forms
   ============================================================ */
a, .btn-link {
    color: #0d6efd;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* ============================================================
   Blazor error UI
   ============================================================ */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #ffcc00;
    color: #333;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    z-index: 9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    font-weight: bold;
}

/* ============================================================
   Scrollbar styling
   ============================================================ */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.app-main::-webkit-scrollbar { width: 6px; }
.app-main::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 4px; }
