﻿/* ================================================================
   IT Management RS — Main Stylesheet
   Design System: Slate dark sidebar + clean white content area
   ================================================================ */

/* ===== GOOGLE FONT ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --rs-blue:       #2563eb;
    --rs-blue-light: #3b82f6;
    --rs-cyan:       #38bdf8;
    --rs-dark:       #0f172a;
    --rs-slate:      #1e293b;
    --rs-slate2:     #334155;
    --rs-muted:      #64748b;
    --rs-light:      #f1f5f9;
    --rs-white:      #ffffff;
    --rs-border:     #e2e8f0;
    --rs-success:    #16a34a;
    --rs-warning:    #f59e0b;
    --rs-danger:     #dc2626;
    --rs-info:       #0891b2;
    --sidebar-w:     240px;
    --navbar-h:      60px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    background: var(--rs-light);
    color: #334155;
    overflow-x: hidden;
}

/* Soft background texture for a modern feed-like workspace */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 8% 8%, rgba(59,130,246,.12), transparent 35%),
        radial-gradient(circle at 92% 0%, rgba(14,165,233,.09), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #f1f5f9 55%, #eef2f7 100%);
    z-index: -1;
    pointer-events: none;
}

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
    height: var(--navbar-h);
    background: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
    color: white;
    padding: 0 20px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-rs {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.3));
}

.nav-brand {
    font-size: 15px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.2px;
}
.nav-brand span { font-weight: 300; opacity: 0.8; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: white;
    text-decoration: none;
    transition: background .18s;
}
.nav-user:hover { background: rgba(255,255,255,.2); color: white; }
.nav-user i { font-size: 16px; }

.nav-btn {
    background: rgba(255,255,255,.15);
    border: none; color: white;
    padding: 7px 12px; border-radius: 7px;
    cursor: pointer; font-size: 13px;
    transition: background .18s;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
.nav-btn:hover { background: rgba(255,255,255,.28); color: white; }
.nav-btn.logout { background: rgba(239,68,68,.25); }
.nav-btn.logout:hover { background: rgba(239,68,68,.45); }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar-area {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    position: fixed; left: 0;
    top: var(--navbar-h);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
    z-index: 1000;
}
.sidebar-area::-webkit-scrollbar { width: 4px; }
.sidebar-area::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.sidebar {
    display: flex; flex-direction: column;
    min-height: calc(100vh - var(--navbar-h));
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; font-size: 13px; font-weight: 700;
    color: #e2e8f0; border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand i { font-size: 20px; color: var(--rs-cyan); }

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 6px;
}
.sidebar-user-avatar { font-size: 28px; color: var(--rs-cyan); flex-shrink: 0; }
.sidebar-user-name {
    font-size: 13px; font-weight: 600; color: #e2e8f0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.sidebar-user-role { font-size: 11px; color: #64748b; margin-top: 1px; }

.sidebar-section-label {
    font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
    color: #475569; padding: 14px 16px 5px;
    text-transform: uppercase; cursor: default;
}
.sidebar-section-label:hover { background: transparent !important; border-left: 3px solid transparent !important; }

.sidebar ul { list-style: none; padding: 0; margin: 0; flex: 1; }

.sidebar li {
    display: flex; align-items: center;
    border-left: 3px solid transparent;
    transition: all .16s ease;
}

.sidebar li a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px 9px 13px;
    width: 100%; color: #94a3b8;
    text-decoration: none; font-size: 13px;
    transition: all .16s ease;
}

.sidebar li:hover { background: rgba(255,255,255,.06); border-left-color: var(--rs-cyan); }
.sidebar li:hover a { color: #e2e8f0; }
.sidebar li:hover i { color: var(--rs-cyan); }
.sidebar li.active { background: rgba(56,189,248,.12); border-left-color: var(--rs-cyan); }
.sidebar li.active a { color: #fff; font-weight: 600; }
.sidebar li.active i { color: var(--rs-cyan); }

.sidebar i {
    width: 17px; text-align: center; font-size: 13.5px;
    color: #64748b; flex-shrink: 0; transition: color .16s;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.07);
    margin-top: auto;
}
.sidebar-footer a {
    display: flex; align-items: center; gap: 10px;
    color: #ef4444; text-decoration: none; font-size: 13px; font-weight: 500;
    padding: 8px 10px; border-radius: 6px; transition: background .16s;
}
.sidebar-footer a:hover { background: rgba(239,68,68,.12); color: #f87171; }
.sidebar-footer i { font-size: 13px; color: #ef4444; width: 17px; text-align: center; }

/* ================================================================
   CONTENT AREA
   ================================================================ */
.content-area {
    margin-left: var(--sidebar-w);
    margin-top: var(--navbar-h);
    padding: 24px;
    min-height: calc(100vh - var(--navbar-h) - 48px);
}

.content-shell {
    max-width: 1480px;
    margin: 0 auto;
}

.content-area > * {
    animation: fadeUp .26s ease;
}

.content-shell > * {
    animation: fadeUp .26s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.content-area > h2, .content-area > h3, .content-area > h4 {
    font-weight: 700; color: #0f172a; margin-bottom: 18px;
}

/* ================================================================
   STAT CARDS (Dashboard)
   ================================================================ */
.stat-card {
    border-radius: 12px !important; border: none !important;
    transition: transform .2s, box-shadow .2s !important; overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,.12) !important;
}
.stat-card .card-body { padding: 20px; }
.stat-card h6 {
    font-size: 11.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    color: #64748b; margin-bottom: 6px;
}
.stat-card h3 { font-size: 32px; font-weight: 800; color: #0f172a; margin: 0; }
.stat-icon {
    font-size: 36px; opacity: .15;
    position: absolute; right: 14px; top: 14px;
}

/* ================================================================
   GENERIC CARD
   ================================================================ */
.card {
    background: var(--rs-white);
    border-radius: 10px !important;
    border: 1px solid var(--rs-border) !important;
    box-shadow: 0 1px 6px rgba(0,0,0,.06) !important;
    transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09) !important; }

.card.soft-card {
    border: 1px solid #dbeafe !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--rs-border) !important;
    font-weight: 600; font-size: 14px; color: #0f172a;
    border-radius: 10px 10px 0 0 !important;
    padding: 14px 18px;
}
.card-body { padding: 18px; }

.card-body > p:last-child,
.card-body > ul:last-child,
.card-body > table:last-child { margin-bottom: 0; }

/* ================================================================
   TABLE
   ================================================================ */
.table {
    border-collapse: separate; border-spacing: 0;
    width: 100%; font-size: 13.5px;
}
.table thead th {
    background: #f1f5f9; color: #475569;
    font-weight: 700; font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .6px;
    padding: 11px 14px;
    border-bottom: 2px solid var(--rs-border);
    white-space: nowrap;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #f0f9ff; }
.table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle; color: #334155;
}
.table-striped tbody tr:nth-child(odd) td { background: #fafbfd; }
.table-striped tbody tr:nth-child(odd):hover td { background: #f0f9ff; }

table:not([class]) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}

table:not([class]) th,
table:not([class]) td {
    padding: 10px 14px;
    border-bottom: 1px solid #eef2f7;
}

table:not([class]) th {
    background: #f8fafc;
    color: #475569;
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: .5px;
}

/* ================================================================
   BADGE / STATUS
   ================================================================ */
.badge {
    font-size: 11px !important; font-weight: 600 !important;
    padding: 4px 9px !important; border-radius: 6px !important;
    letter-spacing: .3px;
}
.badge.bg-secondary { background: #e2e8f0 !important; color: #334155 !important; }
.badge.bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.badge.bg-success   { background: #dcfce7 !important; color: #166534 !important; }
.badge.bg-danger    { background: #fee2e2 !important; color: #991b1b !important; }
.badge.bg-info      { background: #e0f2fe !important; color: #0c4a6e !important; }
.badge.bg-dark      { background: #f1f5f9 !important; color: #475569 !important; }
.badge.bg-primary   { background: #dbeafe !important; color: #1e40af !important; }

/* ================================================================
   FORM
   ================================================================ */
.form-label { font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 5px; }

.form-control, .form-select {
    font-size: 13.5px !important; border-radius: 7px !important;
    border: 1.5px solid #d1d5db !important;
    padding: 8px 12px !important; color: #111827 !important;
    transition: border-color .15s, box-shadow .15s !important;
    background-color: #fff !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--rs-blue) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15) !important;
    outline: none !important;
}
.form-control::placeholder { color: #9ca3af !important; }
textarea.form-control { line-height: 1.6; }

form:not(.d-inline) {
    background: transparent;
}

form > p {
    margin-bottom: 14px;
}

form > p label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

form > p input,
form > p select,
form > p textarea {
    width: 100%;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    font-size: 13px !important; font-weight: 600 !important;
    border-radius: 7px !important; padding: 7px 16px !important;
    transition: all .15s !important;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--rs-blue) !important; border-color: var(--rs-blue) !important; }
.btn-primary:hover {
    background: #1d4ed8 !important; border-color: #1d4ed8 !important;
    box-shadow: 0 4px 12px rgba(37,99,235,.3) !important;
}
.btn-success { background: var(--rs-success) !important; border-color: var(--rs-success) !important; }
.btn-success:hover { background: #15803d !important; border-color: #15803d !important; }
.btn-danger:hover { box-shadow: 0 4px 12px rgba(220,38,38,.25) !important; }
.btn-sm { padding: 5px 11px !important; font-size: 12px !important; }
.btn-lg { padding: 10px 22px !important; font-size: 15px !important; }

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar {
    background: #fff; border: 1px solid var(--rs-border);
    border-radius: 10px; padding: 14px 16px;
    margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ================================================================
   ALERT
   ================================================================ */
.alert {
    border-radius: 9px !important; border: none !important;
    font-size: 13.5px; font-weight: 500; padding: 12px 16px !important;
}
.alert-success { background: #dcfce7 !important; color: #166534 !important; }
.alert-danger  { background: #fee2e2 !important; color: #991b1b !important; }
.alert-warning { background: #fef3c7 !important; color: #92400e !important; }
.alert-info    { background: #e0f2fe !important; color: #0c4a6e !important; }

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination .page-link {
    font-size: 13px; color: var(--rs-blue);
    border-radius: 7px !important; margin: 0 2px;
    border: 1.5px solid var(--rs-border); padding: 6px 12px;
}
.pagination .page-item.active .page-link {
    background: var(--rs-blue) !important;
    border-color: var(--rs-blue) !important; color: white;
}
.pagination .page-link:hover { background: #eff6ff; color: var(--rs-blue); }

/* ================================================================
   DATATABLE overrides
   ================================================================ */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 7px !important; border: 1.5px solid #d1d5db !important;
    padding: 6px 10px !important; font-size: 13px !important;
}
.dataTables_wrapper .dataTables_length select {
    border-radius: 7px !important; border: 1.5px solid #d1d5db !important;
    padding: 5px 8px !important; font-size: 13px !important;
}
.dataTables_info, .dataTables_length { font-size: 12.5px; color: #64748b; }

/* ================================================================
   SECTION TITLE
   ================================================================ */
.section-title {
    font-size: 14px; font-weight: 700; color: #0f172a;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    display: flex; align-items: center; gap: 7px;
}

.content-area h1,
.content-area h2,
.content-area h3,
.content-area h4,
.content-area h5 {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -.01em;
}

.content-area h1 { font-size: 28px; }
.content-area h2 { font-size: 24px; }
.content-area h3 { font-size: 20px; }

.metric-card {
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    border: 1px solid #dbeafe !important;
    border-radius: 12px !important;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-item {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.detail-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-label {
    color: #64748b;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.detail-value {
    color: #0f172a;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.panel-form {
    max-width: 760px;
    margin: 0 auto;
}

.panel-form .card-header {
    background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 100%) !important;
    color: #fff;
    border-bottom: none !important;
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 22px 16px;
}

/* ================================================================
   GLOBAL PAGE HEADER (applies to all templates)
   ================================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 65%, #f0f7ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
}

.page-header h1,
.page-header h2,
.page-header h3 {
    margin: 0;
    font-weight: 800;
    letter-spacing: .1px;
    color: #0f172a;
}

.page-header h2,
.page-header h3 { font-size: 22px; }

/* ================================================================
   DASHBOARD FEED STYLE
   ================================================================ */
.dash-hero {
    border-radius: 16px;
    border: 1px solid #dbeafe;
    background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 52%, #0ea5e9 100%);
    color: #fff;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(37,99,235,.22);
}

.dash-hero-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 4px;
}

.dash-hero-subtitle {
    opacity: .9;
    font-size: 13px;
    margin: 0;
}

.dash-chip-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.28);
    font-size: 12px;
    font-weight: 700;
}

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.dash-kpi {
    border-radius: 12px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.dash-kpi::after {
    content: "";
    position: absolute;
    width: 62px;
    height: 62px;
    right: -14px;
    top: -14px;
    border-radius: 50%;
    background: rgba(37,99,235,.08);
}

.dash-kpi .kpi-label {
    font-size: 11px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.dash-kpi .kpi-value {
    margin-top: 4px;
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.dash-kpi .kpi-icon {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 20px;
    color: #1d4ed8;
    opacity: .6;
}

.dash-action-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.dash-action-row .btn {
    flex: 0 0 auto;
    border-radius: 10px !important;
    padding: 8px 14px !important;
}

.sticky-panel {
    position: sticky;
    top: calc(var(--navbar-h) + 14px);
}

/* ================================================================
   UTILITIES
   ================================================================ */
.blue   { border-left: 6px solid var(--rs-blue); }
.green  { border-left: 6px solid var(--rs-success); }
.orange { border-left: 6px solid var(--rs-warning); }
.red    { border-left: 6px solid var(--rs-danger); }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
    background: var(--rs-white); border-top: 1px solid #e5e7eb;
    padding: 10px 24px; display: flex;
    justify-content: space-between; align-items: center;
    color: #94a3b8; font-size: 12.5px;
    position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
    z-index: 999;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .sidebar-area { position: relative; width: 100%; top: 0; min-height: auto; }
    .content-area { margin-left: 0; margin-top: 0; padding: 15px; }
    .footer { left: 0; position: relative; }
    .nav-brand { display: none; }
    .page-header { border-radius: 10px; padding: 12px; }
    .page-header h2,
    .page-header h3 { font-size: 18px; }
    .dash-hero-title { font-size: 19px; }
    .detail-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ================================================================
   DARK MODE
   ================================================================ */
.dark-btn {
    background: rgba(255,255,255,.2); border: none; color: white;
    padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
body.dark { background: #0f172a; color: #e2e8f0; }
body.dark::before {
    background:
        radial-gradient(circle at 8% 8%, rgba(59,130,246,.14), transparent 35%),
        radial-gradient(circle at 92% 0%, rgba(14,165,233,.12), transparent 30%),
        linear-gradient(180deg, #0b1222 0%, #0f172a 55%, #111827 100%);
}
body.dark .content-area { background: #0f172a; }
body.dark .content-area > h2,
body.dark .content-area > h3,
body.dark .content-area > h4 { color: #e2e8f0; }
body.dark .card { background: #1e293b !important; color: #e2e8f0 !important; border-color: #334155 !important; }
body.dark .card-header { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0; }
body.dark .table thead th { background: #0f172a; color: #94a3b8; border-color: #334155; }
body.dark .table tbody td { color: #e2e8f0; border-color: #1e293b; }
body.dark .table tbody tr:hover td { background: #1e3a5f; }
body.dark .form-control,
body.dark .form-select { background: #1e293b !important; color: #e2e8f0 !important; border-color: #334155 !important; }
body.dark .footer { background: #1e293b; color: #64748b; border-color: #334155; }
body.dark .filter-bar { background: #1e293b; border-color: #334155; }
body.dark .page-header,
body.dark .soft-card { border-color: #334155 !important; }
