/* ── Reset & Base ─────────────────────────────────────────── */
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; font-size: 13px; background: #f0f0f0; }

/* ── Top Navbar ───────────────────────────────────────────── */
.top-navbar {
    background: #333;
    height: 44px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1050;
}
.operator-label { font-size: 12px; color: #ccc; }
.sidebar-toggle { font-size: 18px; padding: 0 8px; }

/* ── Wrapper ──────────────────────────────────────────────── */
#wrapper { padding-top: 44px; min-height: 100vh; transition: all .25s; }

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
    width: 210px;
    min-height: calc(100vh - 44px);
    background: #2b2b2b;
    flex-shrink: 0;
    transition: width .25s;
    overflow: hidden;
}
.sidebar-collapsed #sidebar { width: 0; }

.sidebar-menu li a {
    display: block;
    padding: 10px 18px;
    color: #ccc;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}
.sidebar-menu li a:hover,
.sidebar-menu li.active > a {
    background: #444;
    color: #fff;
}
.sidebar-menu li.active > a { border-left: 3px solid #f90; }

.submenu { background: #222; }
.submenu li a { padding: 8px 18px 8px 36px; font-size: 12px; }
.submenu li.active a { color: #f90; }

/* ── Content Area ─────────────────────────────────────────── */
.content-area { flex: 1; padding: 16px; overflow-x: hidden; }

/* ── Page Header Bar ─────────────────────────────────────── */
.page-header-bar {
    background: #3a87b8;
    color: #fff;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    border-radius: 4px 4px 0 0;
}
.page-header-bar .header-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.page-header-bar h6 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .4px; }

/* ── Card / Panel ─────────────────────────────────────────── */
.glo-card {
    background: #fff;
    border-radius: 0 0 4px 4px;
    border: 1px solid #ddd;
    border-top: none;
}

/* ── Section Title Bar ───────────────────────────────────── */
.section-title {
    background: #4a9fd4;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 5px 12px;
    letter-spacing: .5px;
}

/* ── Search Form ─────────────────────────────────────────── */
.search-form-body { padding: 14px 20px; }

.search-form-body .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 2px;
}
.search-form-body .form-control,
.search-form-body .form-select {
    font-size: 12px;
    border-radius: 2px;
    border: 1px solid #bbb;
    height: 30px;
    padding: 3px 8px;
}
.search-form-body .form-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}
.btn-search {
    background: #f0a500;
    border: none;
    color: #fff;
    font-size: 13px;
    padding: 5px 22px;
    border-radius: 3px;
    cursor: pointer;
}
.btn-search:hover { background: #d4900a; }

/* ── Results Table ───────────────────────────────────────── */
.results-section { padding: 0 20px 16px; }

.results-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #555;
    padding: 8px 0 6px;
}
.rows-per-page select {
    font-size: 12px;
    padding: 1px 4px;
    border: 1px solid #bbb;
    border-radius: 2px;
}

.glo-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.glo-table th {
    background: #3a87b8;
    color: #fff;
    padding: 7px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.glo-table td { padding: 6px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
.glo-table tr:nth-child(even) td { background: #f7f9fb; }
.glo-table tr:hover td { background: #eaf4ff; }
.glo-table .no-results { text-align: center; color: #888; padding: 18px; }

/* ── Status Badges ───────────────────────────────────────── */
.badge-active    { background: #28a745; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge-inactive  { background: #6c757d; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge-suspended { background: #dc3545; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* ── Pagination ──────────────────────────────────────────── */
.glo-pagination { display: flex; gap: 4px; justify-content: flex-end; margin-top: 10px; }
.glo-pagination a, .glo-pagination span {
    padding: 3px 9px; border: 1px solid #bbb; border-radius: 2px;
    font-size: 12px; text-decoration: none; color: #333;
}
.glo-pagination .active { background: #3a87b8; color: #fff; border-color: #3a87b8; }
.glo-pagination a:hover { background: #eaf4ff; }

/* ── Clickable rows ──────────────────────────────────────── */
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #ddeeff !important; }

/* ── Section title bar (List page) ──────────────────────── */
.section-title-bar {
    background: #4a9fd4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
}
.section-title-text {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .5px;
}
.btn-register {
    background: #f0a500;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 3px;
    text-decoration: none;
    white-space: nowrap;
}
.btn-register:hover { background: #d4900a; color: #fff; }

/* ── Alert Messages ──────────────────────────────────────── */
.glo-alert {
    margin: 10px 20px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 12px;
}
.glo-alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.glo-alert-danger  { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
.glo-alert ul      { margin-top: 6px; padding-left: 20px; }

/* ── Form Sections ───────────────────────────────────────── */
.form-section { border-bottom: 1px solid #e0e0e0; }
.form-section:last-of-type { border-bottom: none; }

.form-section-title {
    background: #f0f6fb;
    border-left: 4px solid #3a87b8;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #2a6090;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-section-title i { color: #3a87b8; }

.form-section-body { padding: 2px 0; }

/* ── Customer Form Rows ──────────────────────────────────── */
.cf-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    min-height: 36px;
}
.cf-row:last-child   { border-bottom: none; }
.cf-row:nth-child(even) { background: #f7f9fb; }

.cf-row > label {
    padding: 6px 16px 6px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    text-align: right;
    white-space: nowrap;
}
.req-star { color: #dc3545; }

.cf-input-wrap {
    padding: 4px 16px 4px 12px;
}
.cf-input, .cf-select {
    width: 100%;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 2px;
    padding: 4px 8px;
    height: 28px;
    color: #333;
    background: #fff;
    transition: border-color .15s;
}
.cf-input:focus, .cf-select:focus {
    outline: none;
    border-color: #3a87b8;
    box-shadow: 0 0 0 2px rgba(58,135,184,.15);
}
.cf-select { appearance: auto; }

/* ── Copy button (Billing section) ──────────────────────── */
.btn-copy-mailing {
    margin-left: auto;
    background: #6c757d;
    color: #fff;
    border: none;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 3px;
    cursor: pointer;
}
.btn-copy-mailing:hover { background: #5a6268; }

/* ── Form Action Buttons ─────────────────────────────────── */
.form-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 4px 4px;
}
.btn-save {
    background: #f0a500;
    color: #fff;
    border: none;
    padding: 7px 24px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
}
.btn-save:hover { background: #d4900a; }
.btn-cancel {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 7px 20px;
    font-size: 13px;
    border-radius: 3px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-cancel:hover { background: #5a6268; color: #fff; }

/* ── Back to list button ─────────────────────────────────── */
.btn-back-list {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    opacity: .85;
}
.btn-back-list:hover { opacity: 1; color: #fff; }

/* ════════════════════════════════════════════════════════════
   CUSTOMER INFO form layout  (ci-*)
   Matches the portal screenshots: plain heading, alternating
   gray/white rows, right-aligned label column, full-width input
═══════════════════════════════════════════════════════════════ */

/* Section wrapper */
.ci-section {
    border-bottom: 2px solid #e4e9ee;
    margin-bottom: 0;
}
.ci-section:last-of-type { border-bottom: none; }

/* "Customer Info" heading */
.ci-section-heading {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    padding: 14px 20px 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Copy button inside heading */
.ci-copy-btn {
    margin-left: auto;
    background: #6c757d;
    color: #fff;
    border: none;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
}
.ci-copy-btn:hover { background: #5a6268; }

/* The table of rows */
.ci-table { width: 100%; }

/* Each row: label | value */
.ci-row {
    display: flex;
    align-items: stretch;
    border-top: 1px solid #ebebeb;
    min-height: 36px;
}
.ci-row:nth-child(odd)  { background: #fff; }
.ci-row:nth-child(even) { background: #f3f6f8; }

/* Label cell */
.ci-label {
    width: 230px;
    min-width: 230px;
    text-align: right;
    padding: 7px 14px 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    white-space: nowrap;
}
.ci-icon { color: #3a87b8; font-size: 11px; cursor: default; }

/* Value cell */
.ci-value {
    flex: 1;
    padding: 4px 14px 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Required star in value cell */
.ci-required      { color: #dc3545; font-size: 13px; font-weight: 700; line-height: 1; }
.ci-required-note { margin-left: auto; font-size: 11px; color: #888; align-self: center; }

/* Inputs */
.ci-input {
    flex: 1;
    height: 28px;
    padding: 3px 8px;
    font-size: 12px;
    border: 1px solid #d0d4d8;
    border-radius: 2px;
    color: #333;
    background: #fff;
    min-width: 0;
    transition: border-color .15s, box-shadow .15s;
}
.ci-input:focus {
    outline: none;
    border-color: #3a87b8;
    box-shadow: 0 0 0 2px rgba(58,135,184,.18);
}

/* Width variants */
.ci-input-xs  { max-width: 100px; flex: 0 0 100px; }
.ci-input-sm  { max-width: 340px; }

/* Selects */
.ci-select {
    height: 28px;
    padding: 3px 6px;
    font-size: 12px;
    border: 1px solid #d0d4d8;
    border-radius: 2px;
    color: #333;
    background: #fff;
    transition: border-color .15s;
}
.ci-select:focus {
    outline: none;
    border-color: #3a87b8;
    box-shadow: 0 0 0 2px rgba(58,135,184,.18);
}
.ci-select-sm { min-width: 160px; max-width: 300px; }

/* Checkbox value row */
.ci-value-check { padding-top: 6px; padding-bottom: 6px; }

/* Toggle switch (Parental / Device Scan Consent) */
.ci-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.ci-toggle input[type="checkbox"] { display: none; }
.ci-toggle-slider {
    position: relative;
    width: 36px; height: 18px;
    background: #ccc;
    border-radius: 9px;
    transition: background .2s;
    flex-shrink: 0;
}
.ci-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: left .2s;
}
.ci-toggle input:checked + .ci-toggle-slider { background: #28a745; }
.ci-toggle input:checked + .ci-toggle-slider::after { left: 20px; }
.ci-toggle-label { font-size: 12px; color: #555; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar { width: 0; position: fixed; z-index: 999; height: 100%; top: 44px; }
    #wrapper:not(.sidebar-collapsed) #sidebar { width: 210px; }
    .search-form-body .form-row { grid-template-columns: 1fr; }
    .cf-row { grid-template-columns: 1fr; }
    .cf-row > label { text-align: left; padding: 6px 16px 2px; }
    .ci-row { flex-direction: column; }
    .ci-label { width: 100%; text-align: left; justify-content: flex-start; padding: 6px 14px 2px; }
    .ci-input-sm, .ci-select-sm { max-width: 100%; }
}
