@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600;700&display=swap');

:root {
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

h1,
h2,
h3,
h4,
.login-logo,
.btn {
    font-family: var(--font-heading);
}

code,
pre {
    font-family: var(--font-mono);
}

* {
    box-sizing: border-box;
}

/* Base typography */
body {
    margin: 0;
    background: #f5f7f5;
    color: #172b22;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    padding-top: 70px;
}

/* Links */
a {
    color: #176044;
    text-decoration: none;
}

a:hover {
    color: #d96535;
}

/* Login logo */
.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.login-logo img {
    display: block;
    width: 120px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Fixed top navigation */
.topbar {
    background: #103d30;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 24px;
    flex-wrap: wrap;
}

.topbar.fixed-top {
    width: 100%;
    z-index: 1030;
}

/* Brand */
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    margin: 0;
    padding: 0;
}

.nav-logo {
    width: 50px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.topbar .brand-name {
    color: #e36e30;
    font-size: 18px;
    font-weight: 800;
}

.topbar .brand-text small {
    display: block;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
}

/* Legacy brand mark */
.brand-mark {
    display: grid;
    place-items: center;
    background: #e36e30;
    color: #fff;
    width: 38px;
    height: 38px;
    font-size: 22px;
}

/* Navigation links */
.topbar .navbar-nav .nav-link {
    color: #f3f8f4;
    padding: 10px 13px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 5px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar .navbar-nav .nav-link:hover,
.topbar .navbar-nav .nav-link:focus {
    color: #e36e30;
    background: rgba(255, 255, 255, 0.07);
}

/* Logout link: fit content */
.topbar .navbar-nav .logout-link {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.topbar .navbar-nav .logout-link.w-fit {
    display: inline-flex;
    width: fit-content;
    white-space: nowrap;
}

/* White mobile hamburger */
.topbar .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 6px 10px;
}

.topbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.topbar .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Login button spacing */
.login-card .btn-login {
    margin-top: 20px;
}

/* Main content container */
.container {
    max-width: 1180px;
    margin: 36px auto;
    padding: 0 22px;
    min-height: 65vh;
}

/* Footer */
.footer {
    text-align: center;
    padding: 28px;
    color: #68786f;
    font-size: 12px;
    font-weight: 500;
}

/* Page heading */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d96535;
    font-weight: 800;
}

.page-head h1 {
    margin: 5px 0 0;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.muted {
    color: #697970;
    font-weight: 500;
}

/* Panels, statistics and cards */
.panel,
.stat,
.login-card {
    background: #fff;
    border: 1px solid #e1e8e3;
    padding: 22px;
    box-shadow: 0 8px 24px #183c2b08;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat strong {
    display: block;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
}

.stat span {
    font-size: 13px;
    font-weight: 600;
    color: #52665a;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #176044;
    color: #fff;
    padding: 10px 15px;
    font-family: inherit;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
}

.btn:hover,
button:hover {
    background: #d96535;
    color: #fff;
}

.btn.secondary {
    background: #edf3ef;
    color: #174c36;
}

.btn.danger,
button.danger {
    background: #9f302c;
}

.btn.outline {
    background: #fff;
    border: 1px solid #ccd8d0;
    color: #214c39;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

.field.full button {
    width: fit-content;
    min-width: 120px;
    align-self: flex-end;
    padding: 10px 18px;
}

label {
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #ccd8d0;
    background: #fff;
    padding: 11px 12px;
    color: #172b22;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0;
}

textarea {
    min-height: 145px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #17604433;
    border-color: #176044;
}

.hint {
    font-size: 12px;
    font-weight: 500;
    color: #596b60;
}

/* Tables */
.table-wrap {
    overflow: auto;
    background: #fff;
    border: 1px solid #e1e8e3;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 13px 15px;
    border-bottom: 1px solid #e8eee9;
    vertical-align: top;
}

th {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: #f8faf8;
    color: #52665a;
}

td {
    font-size: 13px;
    font-weight: 500;
}

/* Status labels */
.pill {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    background: #eef2ef;
    color: #405b4b;
}

.pill.published {
    background: #e1f4e8;
    color: #176044;
}

.pill.draft {
    background: #fff1df;
    color: #8b541c;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    margin-bottom: 18px;
    background: #eaf4ed;
    border-left: 4px solid #176044;
    font-weight: 600;
}

.alert.error {
    background: #fff0ef;
    border-color: #b7352d;
}

/* Content cards */
.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* Login page */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #092b22, #174f3a);
}

.login-card {
    width: min(100%, 430px);
    padding: 32px;
}

.login-card h1 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.04em;
    margin: 10px 0;
}

.login-card .field {
    margin: 16px 0;
}

.inline-form {
    display: inline;
}

.small {
    font-size: 12px;
    font-weight: 600;
}

.file-preview {
    max-width: 180px;
    max-height: 120px;
    object-fit: cover;
    display: block;
    margin-top: 8px;
}


/* =========================
   IRIAD ADMIN SIDEBAR
========================= */

.topbar.fixed-top {
    height: 78px;
    width: 100%;
    z-index: 1040;
    background: #103d30;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
}

.sidebar-toggle {
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 7px 10px;
}

.sidebar-toggle .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 78px;
    left: 0;
    bottom: 0;
    width: 250px;
    z-index: 1030;
    background: #103d30;
    color: #fff;
    padding: 28px 16px 18px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-heading {
    color: #a9c4b5;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.17em;
    padding: 0 13px;
    margin-bottom: 15px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 12px 13px;
    border-radius: 7px;
    color: #eaf2ed;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 17px;
    flex-shrink: 0;
}

.sidebar-link:hover,
.sidebar-link:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #f18a4c;
}

/* Optional active link styling */
.sidebar-link.active {
    background: #e36e30;
    color: #fff;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
    margin: 20px 0 12px;
}

.logout-sidebar {
    color: #ffd8ca;
}

.logout-sidebar:hover {
    background: rgba(227, 110, 48, 0.15);
    color: #ff9b70;
}

.sidebar-version {
    padding: 20px 13px 0;
    color: #a9c4b5;
    font-size: 11px;
}

/* Main content sits beside sidebar */
.admin-content {
    width: auto;
    max-width: none;
    min-height: calc(100vh - 78px);
    margin: 0 0 0 250px;
    padding: 36px 30px;
}

/* Keep footer beside the sidebar */
.footer {
    margin-left: 250px;
}


/* Active/current sidebar page */
.sidebar-link.active,
.sidebar-link[aria-current="page"] {
    background: #e36e30;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(227, 110, 48, 0.2);
}

.sidebar-link.active i,
.sidebar-link[aria-current="page"] i {
    color: #ffffff;
}

.sidebar-link.active:hover,
.sidebar-link[aria-current="page"]:hover {
    background: #cf5e25;
    color: #ffffff;
}

.field[hidden] {
    display: none !important;
}


.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pagination-summary {
    margin: 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #d8e2dc;
    border-radius: 8px;
    background: #ffffff;
    color: #103d30;
    text-decoration: none;
    font-size: 22px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.pagination-arrow:hover {
    background: #103d30;
    color: #ffffff;
}

.pagination-arrow.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    font-weight: 600;
    color: #172b22;
}


.filter-actions {
    display: flex;
    flex-direction: row;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
}

.filter-actions button,
.filter-actions .btn {
    width: auto;
    white-space: nowrap;
}

.filter-actions .btn {
    text-align: center;
}

@media (max-width: 576px) {
    .filter-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}


@media (max-width: 576px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination {
        justify-content: center;
    }
}

/* Desktop: sidebar remains visible */
@media (min-width: 992px) {
    .sidebar.collapse {
        display: flex !important;
    }

    .sidebar-toggle {
        display: none;
    }
}

/* Mobile and tablet */
@media (max-width: 991.98px) {
    body {
        padding-top: 78px;
    }

    .sidebar {
        top: 78px;
        width: min(280px, 85vw);
        box-shadow: 8px 10px 25px rgba(0, 0, 0, 0.18);
    }

    .sidebar.collapse:not(.show) {
        display: none;
    }

    .admin-content {
        margin-left: 0;
        width: 100%;
        padding: 28px 18px;
    }

    .footer {
        margin-left: 0;
    }
}


/* Responsive layout and mobile navigation */
@media (max-width: 991.98px) {
    body {
        padding-top: 70px;
    }

    .topbar {
        padding: 10px 18px;
    }

    .topbar .container-fluid {
        flex-wrap: wrap;
    }

    .topbar .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        padding-top: 12px;
    }

    .topbar .navbar-nav {
        align-items: flex-start !important;
        margin-left: 0 !important;
        width: 100%;
        gap: 4px;
    }

    .topbar .navbar-nav .nav-item {
        width: 100%;
        margin-left: 0 !important;
    }

    .topbar .navbar-nav .nav-link {
        display: flex;
        width: 100%;
        text-align: left;
        justify-content: flex-start;
        padding: 11px 8px;
    }

    .topbar .navbar-nav .logout-link.w-fit {
        width: fit-content;
    }

    .topbar .navbar-nav .logout-link {
        margin-top: 6px;
    }
}

@media (max-width: 800px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field.full {
        grid-column: auto;
    }

    .container {
        margin: 24px auto;
        padding: 0 14px;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        width: 38px;
        height: 42px;
    }

    .topbar .brand-name {
        font-size: 16px;
    }

    .topbar .brand-text small {
        font-size: 8px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 24px 20px;
    }
}

/* Extra emphasis for dashboard content */
h1,
h2,
h3,
.page-head h1,
.dashboard-title,
.section-heading {
    font-weight: 800;
}

.metric-value,
.stat strong {
    font-weight: 800;
}

.content-title {
    font-weight: 800;
}

.section-name {
    font-weight: 800;
}

.section-link,
.view-all,
.edit-link {
    font-weight: 800;
}

.status-badge {
    font-weight: 800;
}