/* =====================================================================
   NIDD Dispensary - admin panel styles
   (brand colors are the same as the website, from the NIDD logo)
   ===================================================================== */
:root {
    --navy: #0b0b6b;
    --navy-dark: #06063d;
    --blue: #2433b0;
    --red: #e31e1b;
    --green: #3a9a1e;
    --ink: #0d0f3a;
    --bg: #f3f5fb;
    --border: #e3e7f2;
    --sidebar-width: 260px;
}

body {
    font-family: "Maiandra GD", "Inter", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: #4a5070;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Maiandra GD", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
}

a {
    color: var(--blue);
}

/* ---------- Buttons & forms ---------- */
.btn {
    border-radius: 10px;
    font-weight: 500;
}

.btn-brand {
    background: linear-gradient(135deg, var(--blue), var(--navy));
    border: 0;
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
    color: #fff;
    opacity: .92;
}

.btn-light {
    background: #fff;
    border: 1px solid var(--border);
}

.form-label {
    font-weight: 600;
    font-size: .88rem;
    color: var(--ink);
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 10px;
    border-color: #d9deec;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 51, 176, 0.12);
}

.alert {
    border-radius: 12px;
}

/* ---------- Sidebar ---------- */
.admin-sidebar {
    background: linear-gradient(180deg, var(--navy-dark), var(--navy));
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--sidebar-width);
        overflow-y: auto;
    }

    .admin-main {
        margin-left: var(--sidebar-width);
    }
}

@media (max-width: 991.98px) {
    .admin-sidebar.offcanvas-lg {
        width: var(--sidebar-width);
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
}

.sidebar-brand a {
    display: inline-block;
    background: #fff;
    border-radius: 14px;
    padding: 6px 12px;
}

.sidebar-brand img {
    height: 56px;
    width: auto;
    display: block;
}

.sidebar-menu {
    padding: 10px 12px;
    flex: 1;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: .93rem;
    transition: background .2s ease, color .2s ease;
}

.sidebar-menu a i {
    font-size: 1.05rem;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--red);
}

.sidebar-menu .badge {
    background: var(--red);
}

.sidebar-footer {
    padding: 14px 24px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: .9rem;
}

.sidebar-footer a i {
    margin-right: 8px;
}

.sidebar-footer a:hover {
    color: #fff;
}

/* ---------- Top bar & content ---------- */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.admin-title {
    font-size: 1.25rem;
    margin: 0;
}

.admin-content {
    padding: 28px;
}

@media (max-width: 575.98px) {
    .admin-topbar {
        padding: 12px 16px;
    }

    .admin-content {
        padding: 18px 14px;
    }
}

.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(13, 15, 58, 0.04);
}

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-card-head h2 {
    font-size: 1.05rem;
    margin: 0;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.form-actions {
    padding-top: 8px;
}

/* ---------- Dashboard ---------- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    text-decoration: none;
    color: #6b7090;
    transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(13, 15, 58, 0.08);
    color: #6b7090;
}

.stat-card i {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 1.35rem;
    color: #fff;
}

.stat-card strong {
    display: block;
    font-family: "Maiandra GD", "Plus Jakarta Sans", sans-serif;
    font-size: 1.6rem;
    color: var(--ink);
    line-height: 1.1;
}

.stat-card span {
    font-size: .88rem;
}

@media (max-width: 575.98px) {
    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
    }
}

.stat-red i { background: var(--red); }
.stat-navy i { background: var(--navy); }
.stat-green i { background: var(--green); }
.stat-blue i { background: var(--blue); }

/* ---------- Tables ---------- */
.admin-table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8a8fa8;
    font-weight: 600;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.admin-table td {
    border-color: var(--border);
}

.thumb {
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg);
}

.thumb-tall {
    width: 52px;
    height: 64px;
}

.thumb-wide {
    width: 96px;
    height: 60px;
}

.icon-box {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(36, 51, 176, 0.08);
    color: var(--blue);
    font-size: 1.2rem;
}

.icon-preview {
    min-width: 46px;
    justify-content: center;
    color: var(--blue);
    font-size: 1.2rem;
}

/* Appointment status labels */
.status {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}

.status-new { background: rgba(227, 30, 27, 0.1); color: var(--red); }
.status-confirmed { background: rgba(36, 51, 176, 0.1); color: var(--blue); }
.status-completed { background: rgba(58, 154, 30, 0.12); color: var(--green); }
.status-cancelled { background: #eef0f5; color: #8a8fa8; }

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tabs a {
    padding: .4rem 1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: #4a5070;
    text-decoration: none;
    font-size: .88rem;
}

.filter-tabs a.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.detail-list dt {
    color: #8a8fa8;
    font-weight: 500;
}

.detail-list dd {
    color: var(--ink);
    margin-bottom: .9rem;
}

/* Pagination (CodeIgniter pager) */
.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li a,
.pagination li span {
    display: inline-block;
    padding: .35rem .8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
}

.pagination li.active a {
    background: var(--navy);
    color: #fff;
}

/* ---------- Image upload field ---------- */
.image-field {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
}

.image-field > div {
    min-width: 200px;
}

.image-preview {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: repeating-conic-gradient(#f1f2f7 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    flex-shrink: 0;
}

/* ---------- Text editor (news) ---------- */
#editor {
    min-height: 320px;
    font-size: 1rem;
    background: #fff;
}

.ql-toolbar.ql-snow {
    border-radius: 10px 10px 0 0;
    border-color: #d9deec;
}

.ql-container.ql-snow {
    border-radius: 0 0 10px 10px;
    border-color: #d9deec;
}

/* ---------- Login page ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at 15% 20%, rgba(227, 30, 27, 0.35), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(58, 154, 30, 0.3), transparent 40%),
        linear-gradient(135deg, var(--navy-dark), var(--navy) 60%, var(--blue));
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.login-logo {
    height: 90px;
    width: auto;
}
