/* ============================================================
   KING PRINTING — main.css
   Global variables, resets, body, layout container
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary:        #d946ef;
    --primary-dark:   #c026d3;
    --secondary:      #06b6d4;
    --accent:         #f97316;
    --dark-bg:        #0f172a;
    --card-bg:        #1e293b;
    --border:         #334155;
    --text-primary:   #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted:     #94a3b8;
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
}

/* Light mode overrides */
body.light-mode {
    --dark-bg:        #f1f5f9;
    --card-bg:        #ffffff;
    --border:         #e2e8f0;
    --text-primary:   #1e293b;
    --text-secondary: #475569;
    --text-muted:     #64748b;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}
body.light-mode .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-right: 1px solid #e2e8f0 !important;
}
body.light-mode .card,
body.light-mode .form-card,
body.light-mode .tbl-card,
body.light-mode .stat-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}
body.light-mode .nav-link:hover,
body.light-mode .nav-link.active { background: rgba(217,70,239,0.1) !important; }
body.light-mode .nav-link         { color: #334155 !important; }
body.light-mode .nav-section-title{ color: #64748b !important; }
body.light-mode .page-header      { background: rgba(255,255,255,0.9) !important; border-bottom: 1px solid #e2e8f0 !important; }
body.light-mode .fi-dark input,
body.light-mode .fi-dark select,
body.light-mode .fi-dark textarea  { background: #f8fafc !important; border-color: #cbd5e1 !important; color: #1e293b !important; }
body.light-mode table              { color: #1e293b !important; }
body.light-mode .ih-table th       { background: rgba(217,70,239,0.1) !important; color: #334155 !important; }
body.light-mode .row-item          { border-bottom-color: #f1f5f9 !important; }

/* Scrollbar — hide on html/body */
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; }

/* Scrollbar — content wrapper */
#content-wrapper::-webkit-scrollbar { width: 6px; }
#content-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
#content-wrapper::-webkit-scrollbar-thumb { background: rgba(217,70,239,0.4); border-radius: 4px; }
#content-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(217,70,239,0.7); }

/* Scrollbar — main content */
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.main-content::-webkit-scrollbar-thumb { background: rgba(217,70,239,0.4); border-radius: 4px; }
.main-content::-webkit-scrollbar-thumb:hover { background: rgba(217,70,239,0.7); }
.main-content { scrollbar-width: thin; scrollbar-color: rgba(217,70,239,0.4) rgba(0,0,0,0.1); }

/* Body */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1a1f35 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Animated backdrop */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle 800px at 50% 0%,   rgba(217,70,239,0.08) 0%, transparent 80%),
        radial-gradient(circle 600px at 100% 100%, rgba(6,182,212,0.08)  0%, transparent 80%);
    pointer-events: none;
    z-index: -1;
    animation: backdropShift 12s ease-in-out infinite;
}
@keyframes backdropShift {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* App container */
.container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Content wrapper (right side) */
#content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

/* Main content area */
.main-content {
    width: 100%;
    min-height: 100%;
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Page header */
.page-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(15,23,42,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(217,70,239,0.15);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.breadcrumb       { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.breadcrumb-home  { cursor: pointer; transition: color .2s; }
.breadcrumb-home:hover { color: var(--primary); }
.breadcrumb-sep   { opacity: .5; }
.breadcrumb-current { color: var(--text-secondary); }
.page-title       { font-size: 18px; font-weight: 700; color: var(--text-primary); }

/* Page wrap (inner padding) */
.page-wrap { padding: 28px; }

/* ---- Keyframes ---- */
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .5; }
}

/* Auto-scale breakpoints */
@media (max-width: 1280px) { html { font-size: 14px; } }
@media (max-width: 1100px) {
    html { font-size: 13px; }
    .sidebar { width: 240px !important; min-width: 240px !important; }
}
@media (max-width: 960px) {
    html { font-size: 12px; }
    .sidebar { width: 220px !important; min-width: 220px !important; }
    .stat-grid { grid-template-columns: 1fr 1fr !important; }
}
