/* Global Styles for ClockIt-BillIt */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a2e4a;
    --accent-color: #f5a623;
    --secondary-color: #50C878;
    --danger-color: #E74C3C;
    --warning-color: #f5a623;
    --dark-color: #1a2e4a;
    --light-color: #ECF0F1;
    --border-color: #BDC3C7;
    --success-color: #27AE60;
    --text-color: #34495E;
    --bg-color: #F8F9FA;

    /* Bootstrap primary override */
    --bs-primary: #1a2e4a;
    --bs-primary-rgb: 26, 46, 74;
}

/* Navbar brand */
.cb-navbar {
    background-color: #1a2e4a !important;
}

.cb-brand-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.cb-brand-accent {
    color: #f5a623;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.container-fluid {
    width: 100%;
    padding: 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    margin: 0;
    color: var(--primary-color);
}

/* Header Styles */
header {
    background-color: var(--dark-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1.5;
    vertical-align: middle;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0f1f35;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #C0392B;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #D68910;
}

.btn-secondary {
    background-color: #95A5A6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7F8C8D;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 18px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Form Styles */
form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 46, 74, 0.12);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

thead {
    background-color: var(--dark-color);
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--light-color);
}

tr:hover {
    background-color: var(--bg-color);
}

th {
    font-weight: 600;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #D4EDDA;
    border-color: var(--success-color);
    color: #155724;
}

.alert-error {
    background-color: #F8D7DA;
    border-color: var(--danger-color);
    color: #721C24;
}

.alert-warning {
    background-color: #FFF3CD;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background-color: #D1ECF1;
    border-color: var(--primary-color);
    color: #0C5460;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

.col-2 {
    flex: 0 0 16.666%;
    padding: 0 10px;
}

.col-3 {
    flex: 0 0 25%;
    padding: 0 10px;
}

.col-4 {
    flex: 0 0 33.333%;
    padding: 0 10px;
}

.col-6 {
    flex: 0 0 50%;
    padding: 0 10px;
}

.col-8 {
    flex: 0 0 66.666%;
    padding: 0 10px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.ml-1 { margin-left: 10px; }
.mr-1 { margin-right: 10px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: 10px;
}

.gap-2 {
    gap: 20px;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft {
    background-color: #95A5A6;
    color: white;
}

.badge-sent {
    background-color: var(--primary-color);
    color: white;
}

.badge-paid {
    background-color: var(--success-color);
    color: white;
}

.badge-active {
    background-color: var(--success-color);
    color: white;
}

.badge-completed {
    background-color: var(--primary-color);
    color: white;
}

.badge-on-hold {
    background-color: var(--warning-color);
    color: white;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    header nav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    header nav a {
        display: block;
        text-align: center;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col, .col-2, .col-3, .col-4, .col-6, .col-8 {
        flex: 0 0 100%;
        margin-bottom: 20px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}

/* =============================================================
   SIDEBAR LAYOUT
   ============================================================= */

:root {
    --cb-sidebar-w:           240px;
    --cb-sidebar-w-collapsed:  64px;
    --cb-sidebar-transition:  0.22s ease;
    --cb-topbar-h:             56px;
}

/* ---------- Sidebar shell ---------- */
.cb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--cb-sidebar-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--cb-sidebar-transition), transform var(--cb-sidebar-transition);
}

.cb-sidebar.cb-collapsed {
    width: var(--cb-sidebar-w-collapsed);
}

/* ---------- Brand / logo area ---------- */
.cb-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 68px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.cb-sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.cb-dev-badge {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: #ff6a00;
    color: #fff;
    padding: 3px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ---------- Scrollable nav ---------- */
.cb-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.cb-sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ---------- Individual nav links ---------- */
.cb-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cb-nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.cb-nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #f5a623;
}

.cb-nav-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    line-height: 1;
}

/* ---------- Labels - fade out when collapsed ---------- */
.cb-nav-label {
    opacity: 1;
    transition: opacity var(--cb-sidebar-transition);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.cb-sidebar.cb-collapsed .cb-nav-label {
    opacity: 0;
    pointer-events: none;
    width: 0;
}

/* ---------- Sidebar footer (user / billing / logout / toggle) ---------- */
.cb-sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 6px 0;
}


/* ---------- Brand centering when collapsed ---------- */
.cb-sidebar.cb-collapsed .cb-sidebar-brand {
    justify-content: center;
    padding: 0;
}

.cb-sidebar.cb-collapsed .cb-sidebar-logo-link {
    justify-content: center;
    flex: none;
}

.cb-sidebar.cb-collapsed .cb-dev-badge {
    display: none;
}

/* ---------- Desktop collapse toggle button ---------- */
.cb-collapse-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition: color 0.15s;
}

.cb-collapse-btn:hover {
    color: rgba(255,255,255,0.75);
}

.cb-collapse-label {
    font-size: 0.8rem;
}

.cb-collapse-icon {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    font-size: 0.9rem;
    transition: transform var(--cb-sidebar-transition);
}

.cb-sidebar.cb-collapsed .cb-collapse-icon {
    transform: rotate(180deg);
}

/* ---------- Content wrapper ---------- */
.cb-content-wrap {
    margin-left: var(--cb-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--cb-sidebar-transition);
}

.cb-content-wrap.sidebar-collapsed {
    margin-left: var(--cb-sidebar-w-collapsed);
}

/* ---------- Footer ---------- */
.cb-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 14px 0;
    margin-top: auto;
}

.cb-footer p {
    font-size: 0.82rem;
    color: #6c757d;
}

.cb-footer-link {
    color: #6c757d;
    text-decoration: none;
}

.cb-footer-link:hover {
    color: #1a2e4a;
    text-decoration: underline;
}

/* ---------- Mobile top bar ---------- */
.cb-mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--cb-topbar-h);
    z-index: 1041;
    padding: 0 12px;
    gap: 10px;
    align-items: center;
}

.cb-hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.cb-mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    overflow: hidden;
    min-width: 0;
}

/* ---------- Mobile overlay ---------- */
.cb-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1039;
}

.cb-sidebar-overlay.show {
    display: block;
}

/* ---------- Social share buttons ---------- */
.cb-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1rem;
    color: #6c757d;
    background: transparent;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.cb-share-btn:hover                  { color: #fff; border-color: transparent; }
.cb-share-btn:hover                  { background: #6c757d; }
.cb-share-facebook:hover             { background: #1877f2; }
.cb-share-x:hover                    { background: #000; }
.cb-share-linkedin:hover             { background: #0a66c2; }
.cb-share-whatsapp:hover             { background: #25d366; }
.cb-share-telegram:hover             { background: #229ed9; }

/* ---------- Mobile breakpoint ---------- */
@media (max-width: 991.98px) {
    .cb-sidebar {
        width: var(--cb-sidebar-w) !important;
        transform: translateX(-100%);
    }

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

    .cb-content-wrap,
    .cb-content-wrap.sidebar-collapsed {
        margin-left: 0 !important;
        padding-top: var(--cb-topbar-h);
    }
}

/* =============================================================
   ONLINE PAYMENTS PROMPT (global - appears on multiple pages)
   ============================================================= */

.op-prompt {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 24px;
    background: #1a2e4a;
    border-radius: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.op-prompt-icon {
    font-size: 32px;
    color: #f5a623;
    flex-shrink: 0;
    padding-top: 2px;
}

.op-prompt-body {
    flex: 1;
    min-width: 220px;
}

.op-prompt-body strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #f5a623;
    margin-bottom: 8px;
}

.op-prompt-body p {
    margin: 0;
    font-size: 13px;
    color: #c8d4e3;
    line-height: 1.65;
}

.op-prompt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    align-self: center;
    padding-top: 4px;
}

/* Reset form chrome inside the prompt */
.op-prompt form {
    background: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

/* Amber accent button inside prompt */
.op-prompt .btn-primary {
    background-color: #f5a623;
    color: #1a2e4a;
    font-weight: 700;
    border: none;
}

.op-prompt .btn-primary:hover {
    background-color: #e09415;
    color: #1a2e4a;
}

.op-btn {
    min-width: 140px;
    text-align: center;
    white-space: nowrap;
}

.op-dismiss-btn {
    background: transparent !important;
    border-color: #3d5570 !important;
    color: #8ea5be !important;
}

.op-dismiss-btn:hover {
    background: #253f5e !important;
    border-color: #5a7a9a !important;
    color: #c8d4e3 !important;
}

.op-dismiss-link {
    color: #888;
    font-size: 13px;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.op-dismiss-link:hover {
    color: #555;
}