/* ============================================================
   CONTROL EPP — Design System
   Tema: Industrial-Moderno / Safety First
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --orange:     #F05A1A;
    --orange-lt:  #FF7A3D;
    --orange-bg:  #FFF0EA;
    --navy:       #0D1B2A;
    --navy-mid:   #1A2E45;
    --navy-lt:    #253D57;
    --yellow:     #F7C948;
    --yellow-bg:  #FFFBEA;
    --green:      #22C55E;
    --green-bg:   #EDFDF4;
    --red:        #EF4444;
    --red-bg:     #FEF2F2;
    --blue:       #3B82F6;
    --blue-bg:    #EFF6FF;
    --purple:     #8B5CF6;
    --purple-bg:  #F5F3FF;
    --bg:         #F1F5F9;
    --card-bg:    #FFFFFF;
    --text:       #0D1B2A;
    --text-mid:   #475569;
    --text-lt:    #94A3B8;
    --border:     #E2E8F0;
    --sidebar-w:  260px;
    --topbar-h:   70px;
    --radius:     12px;
    --radius-sm:  8px;
    --shadow:     0 2px 12px rgba(0,0,0,.08);
    --shadow-md:  0 4px 20px rgba(0,0,0,.12);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    font-size: 14.5px;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Oswald', sans-serif;
    letter-spacing: .3px;
}

a { text-decoration: none; color: inherit; }

/* ── Layout Shell ───────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 100%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    padding: 0 !important;
}

.content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 28px 32px;
}


/* ── Mobile Topbar / Offcanvas ─────────────────────────────── */
.mobile-topbar,
.sidebar-close,
.sidebar-backdrop {
    display: none;
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: 62px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.mobile-menu-btn,
.sidebar-close {
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--orange), var(--orange-lt));
    color: #fff;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(240,90,26,.25);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mobile-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 3px;
    border: 1px solid var(--border);
}

.mobile-brand-title {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.05;
}

.mobile-brand-sub {
    font-size: 10px;
    color: var(--text-mid);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ── Sidebar Branding ───────────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--orange), var(--orange-lt));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(240,90,26,.4);
}

.sidebar-brand-text {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
}

.sidebar-brand-sub {
    font-size: 10px;
    color: rgba(255,255,255,.45);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* ── Sidebar Nav ────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    padding: 14px 12px 6px;
    font-family: 'Nunito', sans-serif;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.72);
    font-weight: 600;
    font-size: 13.5px;
    transition: all .18s;
    cursor: pointer;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--orange), var(--orange-lt));
    color: #fff;
    box-shadow: 0 4px 12px rgba(240,90,26,.35);
}

.nav-item .nav-icon {
    width: 22px;
    font-size: 15px;
    text-align: center;
    opacity: .85;
}

.nav-sub {
    padding-left: 16px;
    margin-bottom: 4px;
}

.nav-sub .nav-item {
    font-size: 13px;
    padding: 7px 14px;
    color: rgba(255,255,255,.55);
}

.nav-sub .nav-item::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    flex-shrink: 0;
}

.nav-sub .nav-item:hover, .nav-sub .nav-item.active {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.9);
}

.nav-sub .nav-item.active::before {
    background: var(--orange-lt);
}

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin: 0 0 0 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.07);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--orange), var(--yellow));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    flex-shrink: 0;
}

.user-info-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.user-info-role {
    font-size: 11px;
    color: rgba(255,255,255,.4);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.5);
    font-size: 13px;
    font-weight: 600;
    transition: all .18s;
    width: 100%;
}

.btn-logout:hover {
    background: rgba(239,68,68,.15);
    color: #FCA5A5;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar-title {
    font-family: 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.1;
    margin: 0;
}

.topbar-sub {
    font-size: 13px;
    color: var(--text-mid);
    margin-top: 3px;
    font-weight: 500;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
    position: relative;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.orange::after { background: linear-gradient(90deg, var(--orange), var(--orange-lt)); }
.stat-card.blue::after   { background: linear-gradient(90deg, var(--blue), #60A5FA); }
.stat-card.green::after  { background: linear-gradient(90deg, var(--green), #4ADE80); }
.stat-card.yellow::after { background: linear-gradient(90deg, #F59E0B, var(--yellow)); }
.stat-card.purple::after { background: linear-gradient(90deg, var(--purple), #A78BFA); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.orange { background: var(--orange-bg); }
.stat-icon.blue   { background: var(--blue-bg); }
.stat-icon.green  { background: var(--green-bg); }
.stat-icon.yellow { background: var(--yellow-bg); }
.stat-icon.purple { background: var(--purple-bg); }

.stat-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-mid);
}

.stat-value {
    font-family: 'Oswald', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-header-title {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: #F8FAFC;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-mid);
    padding: 12px 18px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
    font-size: 14px;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
    transition: background .12s;
}

.table tbody tr:hover td {
    background: #FAFBFD;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-mid);
    font-weight: 500;
}

.pagination-info strong {
    color: var(--text);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-mid);
    font-weight: 600;
}

.pagination-size select {
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}

.pagination-size select:focus { border-color: var(--orange); }

.page-btn {
    width: 32px; height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--orange);
    color: var(--orange);
}

.page-btn.active {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
    box-shadow: 0 2px 8px rgba(240,90,26,.3);
}

.page-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: all .18s;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-lt));
    border: none;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(240,90,26,.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #D94E15, var(--orange));
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(240,90,26,.45);
    color: #fff !important;
}

.btn-light {
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text-mid) !important;
}

.btn-light:hover {
    background: #E2E8F0;
    border-color: #CBD5E1;
    color: var(--text) !important;
}

.btn-outline-primary {
    border: 1.5px solid var(--orange);
    color: var(--orange) !important;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--orange-bg);
    color: var(--orange) !important;
}

.btn-outline-secondary {
    border: 1.5px solid var(--border);
    color: var(--text-mid) !important;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg);
    border-color: #94A3B8;
    color: var(--text) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, var(--yellow));
    border: none;
    color: var(--navy) !important;
    font-weight: 700;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #D97706, #F59E0B);
    color: var(--navy) !important;
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #F87171);
    border: none;
    color: #fff !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626, var(--red));
    color: #fff !important;
}

.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 11px;
    border-radius: 20px;
    padding: 4px 10px;
    letter-spacing: .3px;
}

.text-bg-success { background: var(--green-bg) !important; color: #16A34A !important; }
.text-bg-warning { background: var(--yellow-bg) !important; color: #B45309 !important; }
.text-bg-danger  { background: var(--red-bg) !important; color: #DC2626 !important; }
.text-bg-primary { background: var(--blue-bg) !important; color: #1D4ED8 !important; }
.text-bg-secondary { background: #F1F5F9 !important; color: var(--text-mid) !important; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-label {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-mid);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--orange);
}

.form-control, .form-select {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(240,90,26,.12);
    outline: none;
}

.form-control::placeholder { color: var(--text-lt); }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 16px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: var(--green-bg);
    color: #166534;
    border-left-color: var(--green);
}

.alert-warning, .alert-renewal {
    background: var(--yellow-bg);
    color: #92400E;
    border-left-color: #F59E0B;
}

.alert-danger {
    background: var(--red-bg);
    color: #991B1B;
    border-left-color: var(--red);
}

.alert-ok {
    background: var(--green-bg);
    color: #166534;
    border-left-color: var(--green);
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-lt) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrap::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,90,26,.18) 0%, transparent 70%);
    top: -100px; right: -100px;
}

.login-wrap::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(247,201,72,.1) 0%, transparent 70%);
    bottom: -80px; left: -80px;
}

.login-card {
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    padding: 44px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--orange), var(--orange-lt));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(240,90,26,.4);
}

.login-title {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 4px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-mid);
    margin-bottom: 28px;
    font-weight: 500;
}

/* ── Dashboard Sections ─────────────────────────────────────── */
.section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--border);
}

.section-title::before {
    content: '';
    width: 4px; height: 18px;
    background: linear-gradient(180deg, var(--orange), var(--orange-lt));
    border-radius: 2px;
}

/* ── Filter Card ────────────────────────────────────────────── */
.filter-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 22px;
    margin-bottom: 20px;
}

.filter-card-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-mid);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Status Pills ───────────────────────────────────────────── */
.status-active   { color: #16A34A; font-weight: 700; }
.status-inactive { color: #DC2626; font-weight: 700; }

/* ── Misc ───────────────────────────────────────────────────── */
.text-muted { color: var(--text-mid) !important; }

.small-muted {
    font-size: 12px;
    color: var(--text-lt);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    body {
        padding-top: 0;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        display: flex;
        width: 285px;
        max-width: 86vw;
        transform: translateX(-105%);
        transition: transform .22s ease;
        z-index: 1050;
        box-shadow: 16px 0 35px rgba(0,0,0,.25);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: inline-flex;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 16px;
        z-index: 2;
    }

    .sidebar-brand {
        padding-right: 58px;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(13,27,42,.55);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .content {
        margin-left: 0;
        padding: 18px 14px 24px;
    }

    .topbar {
        margin-bottom: 18px;
    }

    .topbar-title {
        font-size: 28px;
    }

    .table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 620px;
    }
}
/* ── Uppercase fields ───────────────────────────────────────── */
.form-control:not([type="email"]):not([type="password"]),
.form-select,
textarea.form-control {
    text-transform: uppercase;
}