/* ═══════════════════════════════════════════════════════════
   NEVSAC ERP — Shared Stylesheet
   ═══════════════════════════════════════════════════════════ */

* { font-family: 'Inter', system-ui, sans-serif; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #334155; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ═══════════════════════════════════════════════════════════
   SIDEBAR — Responsive (fixed, slides in on mobile)
   ═══════════════════════════════════════════════════════════ */
#mainSidebar {
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 1024px) {
    #mainSidebar { transform: translateX(0) !important; }
}

/* Main content offset on desktop */
.main-content { margin-left: 0; }
@media (min-width: 1024px) {
    .main-content { margin-left: 248px; }
}

/* Section labels */
.sidebar-section-label {
    display: block;
    font-size: 9.5px;
    letter-spacing: 0.11em;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    padding: 10px 14px 5px;
    user-select: none;
}

/* Nav items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.14s;
    border-left: 2px solid transparent;
    text-decoration: none;
    width: 100%;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.055); }
.nav-item:hover .nav-label { color: #fff; }
.nav-item:hover .nav-icon  { color: #cbd5e1; }

.nav-active {
    background: linear-gradient(135deg, rgba(37,99,235,0.15) 0%, rgba(16,185,129,0.07) 100%) !important;
    border-left-color: #2563eb !important;
}
.nav-active .nav-label { color: #fff !important; }
.nav-active .nav-icon  { color: #60a5fa !important; }

.nav-label {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    transition: color 0.14s;
    white-space: nowrap;
}
.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #475569;
    transition: color 0.14s;
}

/* Sub items */
.sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.14s;
    text-decoration: none;
    border-left: 2px solid transparent;
}
.sub-item:hover { background: rgba(255,255,255,0.045); }
.sub-item:hover .sub-label { color: #e2e8f0; }
.sub-item:hover .sub-dot   { background: #60a5fa; }

/* Active sub item (inside an open dropdown) */
.sub-item.nav-active {
    background: linear-gradient(135deg, rgba(37,99,235,0.22) 0%, rgba(16,185,129,0.10) 100%) !important;
    border-left-color: #3b82f6 !important;
}
.sub-item.nav-active .sub-label { color: #fff !important; font-weight: 600; }
.sub-item.nav-active .sub-dot {
    background: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96,165,250,0.22);
}

/* Parent nav button when one of its children is active */
.nav-item.parent-active {
    background: rgba(255,255,255,0.05);
}
.nav-item.parent-active .nav-label { color: #e2e8f0; }
.nav-item.parent-active .nav-icon  { color: #60a5fa; }

.sub-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #64748b;
    transition: color 0.14s;
}
.sub-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #334155;
    flex-shrink: 0;
    margin-left: 4px;
    transition: background 0.14s;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR DROPDOWN
   ═══════════════════════════════════════════════════════════ */
.dd-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.dd-body.open { max-height: 640px; }

.chevron { transition: transform 0.22s ease; }
.chevron.open { transform: rotate(180deg); }

/* ═══════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════ */
.topbar-shadow {
    box-shadow: 0 1px 0 0 #e2e8f0, 0 2px 14px -4px rgba(15,23,42,0.07);
}

/* ═══════════════════════════════════════════════════════════
   AI DRAWER
   ═══════════════════════════════════════════════════════════ */
.ai-drawer {
    transform: translateX(100%);
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-drawer.open { transform: translateX(0); }
.drawer-shadow  { box-shadow: -10px 0 44px -4px rgba(15,23,42,0.14); }

/* ═══════════════════════════════════════════════════════════
   BACKDROP
   ═══════════════════════════════════════════════════════════ */
.backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.backdrop.open { opacity: 1; pointer-events: all; }

/* ═══════════════════════════════════════════════════════════
   MOBILE SIDEBAR OVERLAY
   ═══════════════════════════════════════════════════════════ */
.mob-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.mob-overlay.open { opacity: 1; pointer-events: all; }

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes pulse-dot {
    0%, 100% { opacity: 1;    transform: scale(1);    }
    50%       { opacity: 0.5; transform: scale(0.72); }
}
.pulse-dot { animation: pulse-dot 1.8s ease-in-out infinite; }

@keyframes bounce-dot {
    0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
    40%            { transform: translateY(-5px); opacity: 1;   }
}
.bounce-1 { animation: bounce-dot 1.2s infinite 0ms;   }
.bounce-2 { animation: bounce-dot 1.2s infinite 180ms; }
.bounce-3 { animation: bounce-dot 1.2s infinite 360ms; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.75s linear infinite; display: inline-block; }

/* ── AI Chat — Typewriter cursor & generating spinner ───── */
@keyframes ai-gen-spin {
    to { transform: rotate(360deg); }
}
.ai-gen-spinner {
    width:  14px;
    height: 14px;
    border: 2.5px solid #E2E8F0;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: ai-gen-spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes ai-cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
.ai-cursor {
    display: inline-block;
    width: 2px;
    height: 13px;
    background: #3B82F6;
    margin-left: 1px;
    vertical-align: middle;
    border-radius: 1px;
    animation: ai-cursor-blink 0.6s step-end infinite;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN — Left Panel
   ═══════════════════════════════════════════════════════════ */
.steel-grid {
    background-image:
        repeating-linear-gradient(0deg,   transparent, transparent 39px, rgba(255,255,255,0.022) 39px, rgba(255,255,255,0.022) 40px),
        repeating-linear-gradient(90deg,  transparent, transparent 39px, rgba(255,255,255,0.022) 39px, rgba(255,255,255,0.022) 40px);
}
.hex-deco { clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }

@keyframes float-up {
    0%   { transform: translateY(0)     rotate(0deg);   opacity: 0;   }
    10%  { opacity: 0.5; }
    90%  { opacity: 0.2; }
    100% { transform: translateY(-120px) rotate(160deg); opacity: 0;   }
}
.float-particle { position: absolute; border-radius: 2px; animation: float-up linear infinite; }

/* ═══════════════════════════════════════════════════════════
   LOGIN — Form
   ═══════════════════════════════════════════════════════════ */
.erp-input {
    width: 100%;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13.5px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.erp-input::placeholder { color: #94a3b8; }
.erp-input:hover  { border-color: #cbd5e1; background: #fff; }
.erp-input:focus  { border-color: #3b82f6; box-shadow: 0 0 0 3.5px rgba(59,130,246,0.12); background: #fff; }
.erp-input.error  { border-color: #f87171; box-shadow: 0 0 0 3.5px rgba(248,113,113,0.1); }

.login-btn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 4px 14px -2px rgba(16,185,129,0.38);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.13) 0%, transparent 55%);
    border-radius: inherit;
    pointer-events: none;
}
.login-btn:hover  { background: linear-gradient(135deg, #047857 0%, #059669 100%); box-shadow: 0 8px 24px -4px rgba(16,185,129,0.44); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); box-shadow: 0 2px 8px -2px rgba(16,185,129,0.3); }
.login-btn.loading { pointer-events: none; opacity: 0.78; }

@keyframes shake {
    0%,100% { transform: translateX(0);   }
    20%     { transform: translateX(-7px); }
    40%     { transform: translateX(7px);  }
    60%     { transform: translateX(-4px); }
    80%     { transform: translateX(4px);  }
}
.shake { animation: shake 0.4s ease; }
