/* 
   CAMIX Enterprise SaaS Skin for IXP Manager 
   ==========================================
   Designed for clarity, space, and professional ergonomics.
*/

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

:root {
    --brand-primary: #10b981;
    /* CAMIX Green */
    --brand-navy: #020617;
    /* Slate 950 */
    --brand-navy-light: #0f172a;
    /* Slate 900 */
    --brand-orange: #f59e0b;
    --brand-blue: #0ea5e9;
    /* Sky 500 */
    --brand-success: #10b981;
    --brand-danger: #ef4444;
    --brand-warning: #f59e0b;
    --brand-info: #0ea5e9;
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --bg-light: #f6f7f8;
    /* STITCH background-light */
    --bg-white: #ffffff;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    letter-spacing: -0.01em;
    min-height: 100vh;
}

/* =============================================
   TOP BAR / NAV
   ============================================= */
body {
    padding-top: var(--topbar-height);
}

.navbar {
    background-color: var(--bg-white) !important;
    border-bottom: 1px solid var(--border-color);
    height: var(--topbar-height);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    padding: 0 1.5rem !important;
    z-index: 1050;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.navbar-brand img {
    height: 32px !important;
}

.navbar .nav-link {
    color: var(--text-muted) !important;
    font-weight: 400;
    font-size: 0.9rem;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1px;
}

.navbar .nav-link:hover {
    color: var(--brand-primary) !important;
}

/* Topbar Search */
#menu-select-customer-container .select2-container--default .select2-selection--single {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    height: 38px;
    padding-top: 4px;
}

/* =============================================
   SIDE NAVIGATION (Enterprise Navy)
   ============================================= */
#side-navbar.sidebar,
.sidebar {
    background-color: var(--brand-navy) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    /* cleanly separates rather than shadow */
    box-shadow: none !important;
    /* fix weird border effect */
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    overflow-y: auto;
    padding-top: 1rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

#side-navbar.sidebar h6,
.sidebar h6 {
    color: rgba(255, 255, 255, 0.45) !important;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 1.5rem 1.5rem 0.6rem !important;
    margin: 0;
    background: transparent !important;
    border: none !important;
}

#side-navbar.sidebar .nav-link,
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.7rem 1.25rem !important;
    margin: 0.1rem 0.75rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

#side-navbar.sidebar .nav-link i,
.sidebar .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

#side-navbar.sidebar .nav-link:hover,
.sidebar .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}


/* SUB-MENUS */
#side-navbar .nav-sub-menu-item .nav-link,
.sidebar .nav-sub-menu-item .nav-link {
    font-size: 0.80rem;
    padding-left: 1rem;
    opacity: 0.8;
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
#main-div {
    padding: 2.5rem 3rem !important;
    max-width: 1600px;
    margin-bottom: 100px;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 2rem !important;
}

h3 {
    font-family: 'Poppins', 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.03em;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

/* Breadcrumbs / Page Header Preamble */
.page-header-preamble {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* =============================================
   FORMS & INPUTS
   ============================================= */
.form-control,
.select2-container--default .select2-selection--single {
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    background-color: var(--input-bg);
    transition: all 0.2s ease;
    height: auto;
}

.form-control:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(66, 153, 240, 0.15);
    outline: none;
}

label,
.col-form-label {
    font-weight: 600;
    color: var(--brand-navy-light);
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.help-block,
.form-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Form Sections */
legend {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-navy);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    width: 100%;
}

/* =============================================
   ALERTS / BOXES
   ============================================= */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    font-size: 0.92rem;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.alert i {
    font-size: 1.5rem;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

/* Inform boxes in IXP Manager */
.ixp-inform-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* =============================================
   TABLES & LISTS
   ============================================= */
.table-container {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table thead th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}

.table tbody td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Action Buttons in Tables */
.btn-group-sm>.btn,
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

/* =============================================
   DETAIL OVERVIEWS / TABS
   ============================================= */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    gap: 2rem;
}

.nav-tabs .nav-link {
    border: none !important;
    padding: 0.75rem 0;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    font-size: 0.92rem;
}

.nav-tabs .nav-link.active {
    color: var(--brand-blue) !important;
    background: transparent !important;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--brand-primary);
    border-radius: 4px;
}

/* =============================================
   BUTTONS (SaaS Style Expansion)
   ============================================= */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--brand-primary) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
    color: #ffffff !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 800;
}

.btn-primary:hover {
    background-color: var(--brand-navy) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 6, 23, 0.2);
}

.btn-success {
    background-color: var(--brand-success) !important;
    border: none !important;
    color: white !important;
}

.btn-warning {
    background-color: var(--brand-warning) !important;
    border: none !important;
    color: white !important;
}

.btn-danger {
    background-color: var(--brand-danger) !important;
    border: none !important;
    color: white !important;
}

/* =============================================
   RESPONSIVE / LAYOUT
   ============================================= */
@media (max-width: 991px) {
    #main-div {
        padding: 1.5rem !important;
    }

    #side-navbar {
        width: 0;
        position: absolute;
        left: -260px;
    }

    #side-navbar.active {
        width: 260px;
        left: 0;
        position: fixed;
        z-index: 1050;
    }
}

/* =============================================
   FOOTER (Enterprise SaaS)
   ============================================= */
.camix-footer-main,
.camix-footer-bottom {
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 3rem;
    color: var(--text-main);
    transition: margin-left 0.3s ease;
}

@media (min-width: 992px) {

    .camix-footer-main,
    .camix-footer-bottom {
        margin-left: var(--sidebar-width);
    }
}

.camix-footer-main .camix-footer-logo {
    height: 40px !important;
    width: auto !important;
    margin-bottom: 1.5rem;
}

.camix-footer-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.camix-footer-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-navy);
    margin-bottom: 1.25rem;
}

.camix-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.camix-footer-links li {
    margin-bottom: 0.5rem;
}

.camix-footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.camix-footer-links a:hover {
    color: var(--brand-blue);
}

.camix-footer-contact-item {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.camix-footer-icon {
    color: var(--brand-blue);
    width: 14px;
    text-align: center;
}

.camix-footer-bottom {
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.camix-footer-social-btn {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    color: var(--brand-navy);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    transition: all 0.2s;
}

.camix-footer-social-btn:hover {
    background-color: var(--brand-blue);
    color: white;
}

.camix-footer-support-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(243, 146, 0, 0.05);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(243, 146, 0, 0.3);
}

.camix-footer-support-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-orange);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.camix-footer-support-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-navy);
}

/* =============================================
   DATATABLES & TABLES
   ============================================= */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100% !important;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
}

.table thead th {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--brand-navy-light);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem !important;
}

.table tbody td {
    padding: 1rem 1.5rem !important;
    vertical-align: middle;
    border-top: 1px solid #f1f5f9 !important;
    font-size: 0.9rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(248, 250, 252, 0.5);
}

.table tbody tr:hover {
    background-color: rgba(66, 153, 240, 0.04) !important;
}

/* Fix DataTables Unicode issue by using FontAwesome */
table.dataTable thead th {
    position: relative;
    background-image: none !important;
    /* Remove any default background arrows */
}

table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    font-family: 'FontAwesome' !important;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
}

table.dataTable thead th.sorting::after {
    content: "\f0dc" !important;
    right: 12px !important;
}

table.dataTable thead th.sorting_asc::after {
    content: "\f0de" !important;
    opacity: 1;
    right: 12px !important;
}

table.dataTable thead th.sorting_desc::after {
    content: "\f0dd" !important;
    opacity: 1;
    right: 12px !important;
}

/* hide the before elements if they contain the garbled arrow */
table.dataTable thead th::before,
table.dataTable thead td::before {
    content: none !important;
    display: none !important;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--input-border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 0.75rem !important;
    margin-left: 0.5rem !important;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--input-border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.3rem 0.5rem !important;
}

/* Pagination */
.paginate_button {
    border-radius: var(--radius-sm) !important;
    padding: 0.4rem 0.8rem !important;
}

.paginate_button.current {
    background: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: white !important;
}

/* Labels & Badges */
.badge {
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--brand-success);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--brand-danger);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--brand-warning);
}

.badge-primary {
    background-color: rgba(66, 153, 240, 0.1);
    color: var(--brand-blue);
}


/* Topbar Links Refinement */
.camix-top-link {
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: 0.7rem !important;
    letter-spacing: 0.08em;
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 0.8rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.camix-top-link:hover {
    color: var(--brand-blue) !important;
    text-decoration: none;
    background: rgba(66, 153, 240, 0.05);
    border-radius: var(--radius-sm);
}

.camix-top-link i {
    font-size: 0.95rem;
    color: var(--brand-orange);
    opacity: 0.8;
}

.camix-top-link:hover i {
    opacity: 1;
}

/* Footer Logo Size */
.camix-footer-logo-img {
    max-height: 50px;
    margin-bottom: 20px;
}

/* Action Buttons in tables */
.btn-group-xs>.btn,
.btn-xs {
    padding: 2px 8px !important;
    font-size: 11px !important;
    line-height: 1.5;
    border-radius: 4px !important;
}

.table .btn-white {
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.table .btn-white:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}


/* Select2 Skinning */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    height: 38px !important;
    background-color: #f8fafc !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
    padding-left: 12px !important;
    color: var(--text-main) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

/* Sidebar Search Box */
#side-navbar #ixp-search-box {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
    border-radius: var(--radius-md) !important;
    transition: all 0.2s ease;
}

#side-navbar #ixp-search-box:focus {
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(0, 0, 0, 0.3) !important;
    outline: none;
}

#side-navbar #ixp-search-box::placeholder {
    color: rgba(255, 255, 255, 0.25) !important;
}

/* Sidebar Active Parent State */
.sidebar li.active>.nav-link,
.sidebar .nav-item.active>.nav-link {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: var(--brand-info) !important;
    box-shadow: inset 4px 0 0 var(--brand-orange) !important;
    font-weight: 600 !important;
}

/* Sidebar Hover Fix */
.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

/* Sidebar Sub-item Active */
.sidebar .nav-sub-menu-item.active .nav-link {
    background-color: rgba(59, 130, 246, 0.08) !important;
    color: var(--brand-blue) !important;
    box-shadow: inset 4px 0 0 var(--brand-orange) !important;
    font-weight: 700 !important;
    opacity: 1 !important;
}

/* Card Titles */
.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.25rem 1.5rem !important;
}

.card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--brand-navy);
    font-size: 1rem;
    margin: 0;
}