/* ==========================================================
   DSC Billing - application styling
   ========================================================== */

:root {
    --brand: #14477d;
    --brand-dark: #0e3159;
    --brand-light: #e8f0f9;
    --accent: #0a8f5b;
}

body {
    background: #f2f4f7;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #212529;
}

/* ---------- navbar ---------- */
.app-navbar {
    background: linear-gradient(90deg, var(--brand-dark), var(--brand));
    padding: .45rem 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.app-navbar .navbar-brand {
    color: #fff;
    font-weight: 600;
    letter-spacing: .3px;
}

.app-navbar .nav-link {
    color: rgba(255,255,255,.88);
    font-weight: 500;
    padding: .4rem .85rem !important;
    border-radius: 4px;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.dropdown-menu {
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
    border: 1px solid #dde3ea;
}

/* ---------- layout ---------- */
.page-wrap {
    padding: 18px 22px 40px 22px;
    max-width: 1500px;
}

.page-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--brand-dark);
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-light);
}

.page-title .bi { margin-right: 6px; }

.card-panel {
    background: #fff;
    border: 1px solid #e2e7ee;
    border-radius: 6px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}

.card-panel > .panel-head {
    background: #f7f9fc;
    border-bottom: 1px solid #e2e7ee;
    padding: 9px 14px;
    font-weight: 600;
    color: var(--brand-dark);
    border-radius: 6px 6px 0 0;
    font-size: 14px;
}

.card-panel > .panel-body { padding: 14px; }

/* ---------- forms ---------- */
.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 3px;
}

.form-control, .form-select {
    font-size: 13.5px;
    padding: .35rem .6rem;
    border-color: #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .15rem rgba(20,71,125,.15);
}

.req { color: #c62828; }

.fld { margin-bottom: 10px; }

/* ---------- buttons ---------- */
.btn { font-size: 13.5px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* ---------- grids ---------- */
.grid {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    font-size: 13px;
}

.grid th {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    padding: 7px 8px;
    text-align: left;
    white-space: nowrap;
    border: 1px solid #12406f;
}

.grid td {
    padding: 6px 8px;
    border: 1px solid #e3e8ee;
    vertical-align: middle;
}

.grid tr:nth-child(even) td { background: #fafbfd; }
.grid tr:hover td { background: var(--brand-light); }
.grid .num { text-align: right; }
.grid .ctr { text-align: center; }

.grid-wrap { overflow-x: auto; }

.pager td { background: #f1f4f8 !important; padding: 6px !important; }
.pager a, .pager span { padding: 2px 8px; margin: 0 2px; display: inline-block; }
.pager span { font-weight: 700; color: var(--brand-dark); }

/* ---------- dashboard cards ---------- */
.stat {
    background: #fff;
    border: 1px solid #e2e7ee;
    border-left: 4px solid var(--brand);
    border-radius: 6px;
    padding: 14px 16px;
    height: 100%;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}

.stat .lbl { font-size: 12px; color: #6c757d; text-transform: uppercase; letter-spacing: .4px; }
.stat .val { font-size: 24px; font-weight: 700; color: var(--brand-dark); line-height: 1.3; }
.stat .sub { font-size: 12px; color: #8a939c; }
.stat.green  { border-left-color: var(--accent); }
.stat.orange { border-left-color: #e08e0b; }
.stat.red    { border-left-color: #c62828; }

/* ---------- misc ---------- */
.msg-ok {
    background: #e7f6ec; border: 1px solid #b6e0c4; color: #17603a;
    padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 13.5px;
}

.msg-err {
    background: #fdecec; border: 1px solid #f3c0c0; color: #96201f;
    padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 13.5px;
}

.masked { letter-spacing: 2px; color: #97a2ae; }

.badge-paid    { background: #17603a; }
.badge-pending { background: #b45309; }
.badge-partial { background: #1f6feb; }

.footer {
    text-align: center;
    color: #8a939c;
    font-size: 12px;
    padding: 14px 0 22px 0;
}

.small-note { font-size: 12px; color: #6c757d; }

.thumb-preview {
    max-height: 70px; max-width: 170px;
    border: 1px solid #dee2e6; padding: 3px; background: #fff; border-radius: 3px;
}

@media print {
    .no-print, .app-navbar, .footer { display: none !important; }
}

/* ---------- PHP port: plain tables get the old GridView look ---------- */
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td { padding: 7px 9px; border-bottom: 1px solid #e6eaee; }
table.grid th { background: var(--brand-light); font-weight: 600; text-align: left; white-space: nowrap; }
table.grid tr:hover td { background: #fafcfe; }
table.grid td.ctr, table.grid th.ctr { text-align: center; }
table.grid td.num, table.grid th.num { text-align: right; }
.grid-wrap { overflow-x: auto; }
.fld { margin-bottom: 10px; }
