/* ==========================================================
   Unified Operations Workspace (UOW)
   Enterprise Theme v1.0
========================================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    height:100%;
    font-family:Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
    background:#f4f7fb;
    color:#2d3436;
}

/* ==========================================================
   Layout
========================================================== */

.layout{
    display:flex;
    min-height:100vh;
}

/* ==========================================================
   Sidebar
========================================================== */

.sidebar{

    width:260px;

    background:#172B4D;

    color:#fff;

    display:flex;

    flex-direction:column;

    position:fixed;

    left:0;

    top:0;

    bottom:0;

    overflow-y:auto;

    box-shadow:4px 0 18px rgba(0,0,0,.15);

    z-index:1000;

}

/* Scrollbar */

.sidebar::-webkit-scrollbar{

    width:6px;

}

.sidebar::-webkit-scrollbar-thumb{

    background:#4f5f79;

}

/* ==========================================================
   Sidebar Header
========================================================== */

.sidebar-header{

    display:flex;

    align-items:center;

    gap:15px;

    padding:22px 18px;

    border-bottom:1px solid rgba(255,255,255,.08);

}

.logo-circle{

    width:54px;

    height:54px;

    border-radius:50%;

    background: linear-gradient(135deg, #1b3a6b 0%, #295c9e 100%);

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:26px;

    color:white;

}

.sidebar-header h4{

    margin:0;

    font-weight:700;

}

.sidebar-header small{

    color:#c8d2e1;

}

/* ==========================================================
   Section Titles
========================================================== */

.menu-title{

    color:#8da2c0;

    font-size:11px;

    letter-spacing:1.5px;

    font-weight:700;

    padding:18px 20px 8px;

    text-transform:uppercase;

}

/* ==========================================================
   Menu
========================================================== */

.sidebar nav{

    display:flex;

    flex-direction:column;

}

.sidebar nav a{

    display:flex;

    align-items:center;

    gap:14px;

    color:#d9e3f0;

    text-decoration:none;

    padding:13px 20px;

    transition:.25s;

    font-size:15px;

    border-left:4px solid transparent;

}

.sidebar nav a:hover{

    background:#203A63;

    border-left:4px solid #4da3ff;

    color:#fff;

}

.sidebar nav a i{

    width:24px;

    text-align:center;

    font-size:17px;

}

/* ==========================================================
   Sidebar Footer
========================================================== */

.sidebar-footer{

    margin-top:auto;

    border-top:1px solid rgba(255,255,255,.08);

}

.sidebar-footer a{

    display:flex;

    align-items:center;

    gap:14px;

    color:#ffc107;

    padding:18px 20px;

    text-decoration:none;

}

.sidebar-footer a:hover{

    background:#203A63;

}

/* ==========================================================
   Main Wrapper
========================================================== */

.main-wrapper{

    margin-left:260px;

    width:calc(100% - 260px);

    display:flex;

    flex-direction:column;

    min-height:100vh;

}

/* ==========================================================
   Topbar
========================================================== */

.topbar{

    height:78px;

    background:white;

    border-bottom:1px solid #e4e7eb;

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 35px;

    box-shadow:0 3px 8px rgba(0,0,0,.05);

}

.page-title{

    margin:0;

    font-size:24px;

    font-weight:700;

    color:#172B4D;

}

.page-subtitle{

    color:#6c757d;

}

/* ==========================================================
   User Panel
========================================================== */

.user-panel{

    display:flex;

    align-items:center;

    gap:15px;

    text-align:right;

}

.user-icon{

    font-size:42px;

    color:#0d6efd;

}

/* ==========================================================
   Content
========================================================== */

.content-area{

    flex:1;

    padding:30px;

}

/* ==========================================================
   Footer
========================================================== */

.footer{

    background:white;

    border-top:1px solid #dee2e6;

    padding:15px 30px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    color:#6c757d;

    font-size:14px;

}

/* ==========================================================
   Cards
========================================================== */

.card{

    border:none;

    border-radius:12px;

    box-shadow:0 4px 14px rgba(0,0,0,.08);

}

.card-header{

    background:#fff;

    font-weight:600;

    border-bottom:1px solid #ececec;

}

/* ==========================================================
   Tables
========================================================== */

.table{

    background:white;

}

.table thead{

    background:#edf2f7;

}

.table thead th{

    font-weight:600;

    border-bottom:none;

}

.table-hover tbody tr:hover{

    background:#f7fbff;

}

/* ==========================================================
   Buttons
========================================================== */

.btn{

    border-radius:8px;

}

.btn-primary{
    background: linear-gradient(135deg, #1b3a6b 0%, #295c9e 100%) !important;
    border-color: #1b3a6b !important;
    color: #ffffff !important;
}

.btn-primary:hover{
    background: linear-gradient(135deg, #142c52 0%, #204980 100%) !important;
    border-color: #142c52 !important;
    color: #ffffff !important;
}

/* ==========================================================
   Forms
========================================================== */

.form-control,
.form-select{

    border-radius:8px;

}

.form-control:focus,
.form-select:focus{

    box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.18);

    border-color: #295c9e;

}

/* ==========================================================
   Alerts
========================================================== */

.alert{

    border:none;

    border-radius:10px;

}

/* ==========================================================
   Responsive
========================================================== */

/* ---- Hamburger Toggle (hidden on desktop) ---- */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1100;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: #172B4D;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
    align-items: center;
    justify-content: center;
    transition: .25s;
}

.sidebar-toggle:hover {
    background: #0d6efd;
}

/* Sidebar overlay backdrop (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
}

/* ---- Tablet: ≤992px — icon-only sidebar ---- */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header h4,
    .sidebar-header small,
    .menu-title,
    .sidebar nav a span,
    .sidebar nav a .small,
    .sidebar nav a .bi-chevron-down {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
        padding: 14px;
    }

    .logo-circle {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .sidebar nav a {
        justify-content: center;
        padding: 14px;
        gap: 0;
        border-left: 3px solid transparent;
    }

    .sidebar nav a i {
        margin: 0;
        font-size: 20px;
    }

    .sidebar-footer a {
        justify-content: center;
        padding: 14px;
        gap: 0;
    }

    .sidebar-footer a span,
    .sidebar-footer a .small {
        display: none;
    }

    .main-wrapper {
        margin-left: 70px;
        width: calc(100% - 70px);
    }

    .topbar {
        padding: 0 20px;
    }

    .page-title {
        font-size: 18px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .content-area {
        padding: 20px;
    }

    .footer {
        font-size: 12px;
        padding: 12px 20px;
    }

    .user-icon {
        font-size: 32px;
    }

    /* Make all tables horizontally scrollable */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* ---- Mobile: ≤768px — off-canvas sidebar ---- */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar.is-open ~ .sidebar-overlay {
        display: block;
    }

    /* When sidebar is open, re-show text */
    .sidebar.is-open .sidebar-header h4,
    .sidebar.is-open .sidebar-header small,
    .sidebar.is-open .menu-title,
    .sidebar.is-open nav a span,
    .sidebar.is-open .sidebar-footer a span {
        display: inline;
    }

    .sidebar.is-open nav a {
        justify-content: flex-start;
        gap: 14px;
    }

    .sidebar.is-open .sidebar-header {
        justify-content: flex-start;
        gap: 15px;
        padding: 22px 18px;
    }

    .sidebar.is-open .logo-circle {
        width: 54px;
        height: 54px;
        font-size: 26px;
    }

    .sidebar.is-open .sidebar-footer a {
        justify-content: flex-start;
        gap: 14px;
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        flex-direction: column;
        height: auto;
        padding: 15px;
        padding-left: 62px; /* Leave space for hamburger */
        gap: 8px;
        align-items: flex-start;
    }

    .page-title {
        font-size: 16px;
    }

    .page-subtitle {
        font-size: 11px;
    }

    .user-panel {
        display: none;
    }

    .content-area {
        padding: 15px 12px;
    }

    .footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        font-size: 11px;
        padding: 10px 15px;
    }

    /* Cards */
    .card {
        border-radius: 8px;
    }

    /* Buttons - touch-friendly */
    .btn {
        min-height: 40px;
        font-size: 14px;
    }

    .btn-sm {
        min-height: 34px;
    }

    /* Forms */
    .form-control,
    .form-select {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    /* Modals */
    .modal-dialog {
        margin: 10px;
    }

    .modal-lg {
        max-width: calc(100vw - 20px);
    }

    /* Tables: make cells wrap better */
    .table td,
    .table th {
        white-space: nowrap;
        font-size: 13px;
    }
}

/* ---- Small Mobile: ≤480px ---- */
@media (max-width: 480px) {
    .topbar {
        padding: 10px 12px 10px 56px;
    }

    .page-title {
        font-size: 14px;
    }

    .content-area {
        padding: 10px 8px;
    }

    .card-header {
        padding: 0.6rem 0.75rem;
        font-size: 13px;
    }

    .card-body {
        padding: 0.75rem;
    }

    /* Stack action buttons */
    .btn-group,
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }
}

/* ==========================================================
   Workspace Site Module Icon Colors
========================================================== */


.sidebar nav a .bi-geo-alt-fill {
    color:#4da3ff;
}


.sidebar nav a .bi-diagram-3 {
    color:#00c853;
}


.sidebar nav a .bi-hdd-network {
    color:#00bcd4;
}


.sidebar nav a .bi-ethernet {
    color:#ff9800;
}


.sidebar nav a .bi-activity {
    color:#ff5252;
}


.sidebar nav a .bi-diagram-2 {
    color:#b388ff;
}


.sidebar nav a .bi-tags {
    color:#ffd740;
}


.sidebar nav a .bi-pc-display {
    color:#40c4ff;
}


.sidebar nav a .bi-file-earmark-text {
    color:#bdbdbd;
}

.sidebar nav a .bi-speedometer2 {
    color:#00d2ff;
}

.sidebar nav a .bi-folder2-open {
    color:#3a86ff;
}

.sidebar nav a .bi-building {
    color:#8338ec;
}

.sidebar nav a .bi-shield-lock {
    color:#ff006e;
}

.sidebar nav a .bi-person-badge {
    color:#fb5607;
}

.sidebar nav a .bi-link-45deg {
    color:#ffbe0b;
}

.sidebar nav a .bi-people {
    color:#38b000;
}

/* ==========================================================
   Enterprise Blue Header & Table Styles
========================================================== */

.card-header-blue {
    background: linear-gradient(135deg, #1b3a6b 0%, #295c9e 100%) !important;
    color: #ffffff !important;
    border-bottom: 2px solid #295c9e !important;
}

.table-header-blue,
.table-header-blue tr,
.table-header-blue th {
    background: #1b3a6b !important;
    color: #ffffff !important;
    border-color: #295c9e !important;
    font-weight: 600 !important;
}