/* ============================================================
   IT Gestiune — Stil principal
   Design: Industrial/Utilitarian - Sidebar dark, content light
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Barlow:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0f1923;
    --sidebar-border: #1e2d3d;
    --sidebar-text: #8899aa;
    --sidebar-active: #00d4ff;
    --sidebar-active-bg: rgba(0, 212, 255, 0.1);
    --topbar-height: 60px;
    --accent: #0099cc;
    --accent-2: #00d4ff;
    --success: #00c896;
    --warning: #ffb800;
    --danger: #ff4757;
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --text-main: #1a2634;
    --text-muted: #6b7a8d;
    --border: #dde3ec;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 24px rgba(0,0,0,0.14);
    --radius: 10px;
    --font-body: 'Barlow', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 14px;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-right: 1px solid var(--sidebar-border);
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
    flex-shrink: 0;
}
.brand-main {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.brand-sub {
    display: block;
    font-size: 11px;
    color: var(--sidebar-text);
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: #2a3f55 transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #2a3f55; border-radius: 4px; }

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #3a5068;
    padding: 14px 18px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    position: relative;
}
.nav-item i {
    width: 18px; text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}
.nav-item:hover {
    color: #ccd9e8;
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(0,212,255,0.4);
}
.nav-item.active {
    color: var(--sidebar-active);
    background: var(--sidebar-active-bg);
    border-left-color: var(--sidebar-active);
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar { font-size: 26px; color: #3a5a78; flex-shrink: 0; }
.user-details { flex: 1; min-width: 0; }
.user-name {
    display: block;
    font-size: 13px; font-weight: 600;
    color: #ccd9e8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
    display: block;
    font-size: 11px; color: var(--sidebar-text);
}
.btn-logout {
    color: #5a7a99;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-logout:hover { color: var(--danger); background: rgba(255,71,87,0.1); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 14px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar-toggle {
    color: var(--text-muted);
    font-size: 18px;
    padding: 4px 8px;
    border: none;
}
.topbar-breadcrumb {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.topbar-actions { display: flex; gap: 8px; }

.page-content {
    flex: 1;
    padding: 24px;
    max-width: 1600px;
    width: 100%;
}

/* ============================================================
   SIDEBAR COLLAPSED
   ============================================================ */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}
body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body { padding: 20px; }
.card:hover { box-shadow: var(--shadow-hover); transition: box-shadow 0.2s; }

/* ============================================================
   STAT CARDS (dashboard)
   ============================================================ */
.stat-card {
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 60px; height: 100%;
    opacity: 0.08;
}
.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    color: inherit;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-content { flex: 1; }
.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-mono);
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 3px;
}

.stat-blue .stat-icon { background: rgba(0,153,204,0.12); color: var(--accent); }
.stat-green .stat-icon { background: rgba(0,200,150,0.12); color: var(--success); }
.stat-red .stat-icon { background: rgba(255,71,87,0.12); color: var(--danger); }
.stat-orange .stat-icon { background: rgba(255,184,0,0.12); color: var(--warning); }
.stat-purple .stat-icon { background: rgba(156,39,176,0.12); color: #9c27b0; }
.stat-teal .stat-icon { background: rgba(0,150,136,0.12); color: #009688; }

/* ============================================================
   TABLES
   ============================================================ */
.table { font-size: 13.5px; }
.table > thead > tr > th {
    background: #f7f9fc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 10px 12px;
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: 10px 12px;
    vertical-align: middle;
    border-color: #f0f4f8;
}
.table-hover tbody tr:hover { background: #f7fbff; }

.equipment-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.form-control, .form-select {
    border-color: var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    padding: 7px 11px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,153,204,0.12);
}
.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 0 8px;
    border-bottom: 2px solid #e8f4ff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 4px 8px;
    border-radius: 5px;
}

/* ============================================================
   HISTORY TIMELINE
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 10px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-dot {
    position: absolute;
    left: -23px; top: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 8px;
    color: var(--accent);
}
.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ============================================================
   STATUS INDICATORS
   ============================================================ */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.status-dot.activ { background: var(--success); box-shadow: 0 0 6px rgba(0,200,150,0.5); }
.status-dot.defect { background: var(--danger); box-shadow: 0 0 6px rgba(255,71,87,0.5); }
.status-dot.in_reparatie { background: var(--warning); }
.status-dot.casat { background: #9e9e9e; }

/* ============================================================
   NETWORK INFO
   ============================================================ */
.ip-address {
    font-family: var(--font-mono);
    font-size: 13px;
    background: #f0f7ff;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #d0e8ff;
    color: #1565c0;
}
.mac-address {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #546e7a;
}

/* ============================================================
   TONER METER
   ============================================================ */
.toner-bar { height: 8px; border-radius: 4px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header h1 i {
    color: var(--accent);
}

/* ============================================================
   EQUIPMENT DETAIL TABS
   ============================================================ */
.nav-tabs .nav-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
}
.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: none;
}
.nav-tabs { border-bottom: 1px solid var(--border); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 20px;
}
.filter-bar .row { row-gap: 10px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border-radius: var(--radius); border: none; font-size: 13.5px; }
.alert-success { background: #e8f9f4; color: #1a6e52; }
.alert-danger  { background: #fff0f1; color: #8b1a24; }
.alert-warning { background: #fff8e1; color: #7a5400; }
.alert-info    { background: #e3f2fd; color: #0d47a1; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-size: 13px; font-weight: 500; border-radius: 7px; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #0077aa; border-color: #0077aa; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
body.login-page {
    background: linear-gradient(135deg, #0f1923 0%, #1a2d40 50%, #0d2233 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    color: #fff;
}
.login-logo {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
    margin: 0 auto 20px;
}
.login-card h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.login-card .subtitle {
    text-align: center;
    font-size: 13px;
    color: #6b8aa8;
    margin-bottom: 32px;
}
.login-card .form-label { color: #8899aa; }
.login-card .form-control {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}
.login-card .form-control:focus {
    background: rgba(255,255,255,0.09);
    border-color: var(--accent);
    color: #fff;
}
.login-card .form-control::placeholder { color: #4a6478; }
.btn-login {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none; color: #fff;
    font-weight: 600; width: 100%;
    padding: 10px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-login:hover { opacity: 0.9; color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    body.sidebar-collapsed .sidebar { transform: translateX(0); }
    body.sidebar-collapsed .main-content { margin-left: 0; }
    .page-content { padding: 14px; }
    .topbar { padding: 0 14px; }
    .topbar-actions .btn-warning { display: none; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar, .topbar, .topbar-actions, .btn, .filter-bar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ============================================================
   DATATABLES OVERRIDES
   ============================================================ */
div.dataTables_wrapper div.dataTables_filter input { 
    border-radius: 7px;
    border: 1px solid var(--border);
    font-size: 13px;
    padding: 5px 10px;
}
div.dataTables_wrapper .dt-buttons .btn { 
    font-size: 12px; 
    padding: 4px 10px;
}
