/*
 * HostBill Flavor Theme - Bootstrap 5
 * Custom styles to complement Bootstrap 5
 */

:root {
    --bs-primary: #0d6efd;
    --bs-primary-rgb: 13, 110, 253;
    --theme-body-bg: #f8f9fa;
}

body {
    background-color: var(--theme-body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > .container:last-of-type {
    flex: 1;
}

/* Navbar adjustments */
.navbar-brand {
    font-weight: 600;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,.125);
    font-weight: 600;
}

/* Tables */
.table > :not(caption) > * > * {
    padding: 0.75rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6c757d;
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    font-weight: 500;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Status badges (HostBill specific) */
.label-Active, .badge-Active { background-color: #198754 !important; color: white; }
.label-Pending, .badge-Pending { background-color: #ffc107 !important; color: #000; }
.label-Suspended, .badge-Suspended { background-color: #dc3545 !important; color: white; }
.label-Cancelled, .badge-Cancelled { background-color: #6c757d !important; color: white; }
.label-Terminated, .badge-Terminated { background-color: #343a40 !important; color: white; }
.label-Open, .badge-Open { background-color: #198754 !important; color: white; }
.label-Answered, .badge-Answered { background-color: #0dcaf0 !important; color: #000; }
.label-Customer-Reply, .badge-Customer-Reply { background-color: #ffc107 !important; color: #000; }
.label-Closed, .badge-Closed { background-color: #6c757d !important; color: white; }
.label-Paid, .badge-Paid { background-color: #198754 !important; color: white; }
.label-Unpaid, .badge-Unpaid { background-color: #dc3545 !important; color: white; }

/* Dashboard blocks */
.dashboardblock {
    margin-bottom: 1rem;
}

.dashboardblock .internal {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

.dashboardblock h4 {
    margin-bottom: 1rem;
}

.dashboardblock h4 a {
    text-decoration: none;
    color: inherit;
}

/* Wbox (HostBill widget box) */
.wbox {
    background: white;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

.wbox_header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wbox_header.nbottom {
    border-bottom: none;
}

.wbox_content {
    padding: 1.25rem;
}

.wbox_right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Sidebar menu */
.nice-sidemenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nice-sidemenu li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.nice-sidemenu li:last-child {
    border-bottom: none;
}

.nice-sidemenu li a {
    text-decoration: none;
    font-weight: 500;
}

.nice-sidemenu li small {
    display: block;
    color: #6c757d;
    margin-top: 0.25rem;
}

.nice-sidemenu li i {
    margin-right: 0.5rem;
    color: var(--bs-primary);
}

/* Dark header */
.darkheader {
    background: #343a40;
    color: white;
    padding: 0.75rem 1rem;
    margin: 0 0 1rem 0;
    border-radius: 0.375rem;
}

/* Green box for credit */
.greenbox {
    background: #d1e7dd;
    color: #0f5132;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Login box */
#loginbox_container {
    max-width: 450px;
    margin: 2rem auto;
}

/* Submenu navigation pills */
.nav-pills .nav-link.active {
    background-color: var(--bs-primary);
}

/* Invoice print styles */
@media print {
    .navbar, footer, .nav-pills, .btn {
        display: none !important;
    }
}

/* Utility classes */
.left { float: left; }
.right { float: right; }
.clear { clear: both; }
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive helpers */
@media (max-width: 767.98px) {
    .wbox_header {
        flex-direction: column;
        align-items: flex-start;
    }
    .wbox_right {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
}

/* Row flexbox (HostBill compatibility) */
.row.flex-container {
    display: flex;
    flex-wrap: wrap;
}

.flex-box-1 {
    flex: 1;
}

/* Bordered section */
.bordered-section {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

/* Box feature small (sidebar) */
.box-feature-small {
    min-width: 200px;
    margin-bottom: 1rem;
}

/* Article/content area */
.article {
    flex: 1;
    min-width: 0;
}

/* Full screen tables */
.table.fullscreen {
    width: 100%;
}

/* View link style */
a.view3 {
    text-decoration: none;
    color: var(--bs-primary);
}

/* Divider */
.divider {
    height: 1px;
    background: #dee2e6;
    margin: 1.5rem 0;
}

/* Dropdown fixes for Bootstrap 5 */
.dropdown-menu.show {
    display: block;
}

/* Icon sizing */
.iconfont-size5 {
    font-size: 3rem;
}

.silver {
    color: #adb5bd;
}

/* Welcome back header */
#welcomeback {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#welcomeback h3 {
    margin: 0;
}

/* Dashboard row */
.dashrow {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashrow .dashboardblock {
    flex: 1 1 200px;
    max-width: 300px;
}

/* Slides container */
#slides {
    margin-bottom: 1.5rem;
}

/* Form actions */
.form-actions {
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Styled labels */
label.styled {
    font-weight: 500;
    margin-bottom: 0.375rem;
    display: block;
}

/* Input styled */
input.styled, select.styled, textarea.styled {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

input.styled:focus, select.styled:focus, textarea.styled:focus {
    border-color: var(--bs-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* List item links */
a.list_item {
    display: block;
    margin-bottom: 0.25rem;
}

/* Muted text */
.muted {
    color: #6c757d !important;
}

/* Width helpers */
.w240 {
    width: 240px;
    max-width: 100%;
}

/* Span grid (Bootstrap 2 compatibility) */
.span2 { width: 16.666%; }
.span3 { width: 25%; }
.span9 { width: 75%; }
.span10 { width: 83.333%; }
.span12 { width: 100%; }

@media (max-width: 767.98px) {
    .span2, .span3, .span9, .span10 {
        width: 100%;
    }
}
