:root {
    --ndl-orange: #ab3402;
	--ndl-orange-dark: #8f2b01;
    --ndl-blue:   #0289ab;
    --ndl-purple: #6702ab;
    --ndl-bg:     #0f1117;
    --ndl-card:   #1b1e27;
    --ndl-text:   #e6e6e6;
}

* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #151823, var(--ndl-bg));
    color: var(--ndl-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ndl-card h1 {
    position: relative;
    padding-left: 14px;
}

.ndl-card h1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 4px;
    background: var(--ndl-orange);
    border-radius: 2px;
}

.ndl-card {
    background: var(--ndl-card);
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
    border-top: 4px solid var(--ndl-blue);
}

.ndl-logo {
    display: block;
    margin: 0 auto 20px;
    max-height: 200px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    opacity: .85;
}

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    background: #0e1016;
    color: #fff;
    margin-bottom: 16px;
}

input:focus {
    outline: 2px solid var(--ndl-blue);
}

button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--ndl-blue), var(--ndl-purple));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    opacity: .9;
}

.error {
    background: rgba(171,52,2,.15);
    border-left: 4px solid var(--ndl-orange);
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.ndl-page {
    width: 100%;
    display: flex;
    justify-content: center;
}

.ndl-container {
    max-width: 1100px;
    padding: 0 20px;
}

.ndl-select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border-radius: 8px;
    border: none;
    background:
        linear-gradient(135deg, var(--ndl-blue), var(--ndl-purple)) right 12px center / 10px 10px no-repeat,
        #0e1016;
    color: #fff;
    appearance: none;
    cursor: pointer;
}

.ndl-select:focus {
    outline: 2px solid var(--ndl-blue);
}

.ndl-back:hover {
    background:#151823;
}

.ndl-back {
    display:inline-block;
    padding:8px 12px;
    border-radius:8px;
    background: linear-gradient(
        135deg,
        var(--ndl-orange),
        var(--ndl-purple)
    );
    color:#fff;
    text-decoration:none;
    font-weight:500;
}

.ndl-back:hover {
    background:#151823;
}

.ndl-divider {
    height: 2px;
    width: 60%;
    margin: 24px auto;
    border-radius: 2px;

    background: linear-gradient(
        to right,
        transparent 0%,
        var(--ndl-orange) 20%,
        var(--ndl-orange) 80%,
        transparent 100%
    );

    animation: ndl-divider-breathe 4.5s ease-in-out infinite;
    opacity: 0.85;
}

/* Breathing animation */
@keyframes ndl-divider-breathe {
    0% {
        clip-path: inset(0 45% 0 45%);
        opacity: 0.5;
    }
    50% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
    100% {
        clip-path: inset(0 45% 0 45%);
        opacity: 0.5;
    }
}

.project-name-input {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color .15s ease, background .15s ease;
}

.project-name-input:focus {
    border-color: var(--ndl-orange);
    background: rgba(255,255,255,0.06);
    outline: none;
}

.project-save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.project-saved {
    display: none;
    font-size: 13px;
    color: var(--ndl-orange);
    transition: opacity .3s ease;
}

.project-card {
    position: relative; /* ← THIS is the key line */

    background: var(--ndl-card);
    padding: 26px 24px;
    border-radius: 16px;

    border: 1px solid rgba(255,255,255,0.08);
    border-left: 5px solid var(--ndl-purple);

    text-decoration: none;
    color: #fff;

    display: flex;
    flex-direction: column;
    justify-content: center;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.project-card strong {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .2px;
}

.project-card small {
    opacity: .7;
    margin-top: 4px;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    border-left-color: var(--ndl-orange);
}

.project-card::after {
    content: '↗';
    position: absolute;
    top: 16px;
    right: 16px;
    opacity: 0.35;
    transition: opacity .15s ease;
}

.project-card:hover::after {
    opacity: 0.8;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* =====================
   PAGE: PROJECTS
===================== */
body.page-projects {
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
}

.page-projects .projects {
    max-width: 900px;
    width: 100%;
    padding: 0 20px;
}

.page-projects .top-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
    text-align: center;
}

.page-projects .project-badge {
    height: 100px;
}

.page-projects .projects-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.page-projects .projects-subtitle {
    font-size: 14px;
    opacity: .65;
    margin-top: 4px;
}

.page-projects .logout {
    color: var(--ndl-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid rgba(2,137,171,.35);
    background: rgba(2,137,171,.08);
    transition: background .15s, border-color .15s;
}

.page-projects .logout:hover {
    background: rgba(2,137,171,.16);
    border-color: rgba(2,137,171,.6);
}

.page-projects .btn-admin {
    color: var(--ndl-orange);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid rgba(171,52,2,.35);
    background: rgba(171,52,2,.1);
    transition: background .15s, border-color .15s;
}

.page-projects .btn-admin:hover {
    background: rgba(171,52,2,.2);
    border-color: rgba(171,52,2,.6);
}

.page-projects .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.page-projects .project-card {
    background: var(--ndl-card);
    padding: 22px;
    border-radius: 12px;
    border-left: 4px solid var(--ndl-purple);
    text-decoration: none;
    color: #fff;
    transition: transform .15s ease;
}

.page-projects .project-card:hover {
    transform: translateY(-4px);
    border-left-color: var(--ndl-blue);
}

.page-projects .projects-footer {
    width: 100%;
    text-align: center;
    margin-top: 28px;
    padding: 0 20px 28px;
    opacity: .82;
}

.page-projects .projects-footer p {
    margin: 0;
}

.page-projects .projects-footer p + p {
    margin-top: 6px;
}

/* =====================
   PROJECT CARD DIVIDER
===================== */
.project-divider {
    height: 2px;
    width: 70%;
    margin: 14px auto 0;
    border-radius: 2px;

    background: linear-gradient(
        to right,
        transparent 0%,
        var(--ndl-orange) 20%,
        var(--ndl-orange) 80%,
        transparent 100%
    );

    opacity: 0.6;
    animation: project-divider-breathe 5.5s ease-in-out infinite;
}

@keyframes project-divider-breathe {
    0% {
        clip-path: inset(0 45% 0 45%);
        opacity: 0.4;
    }
    50% {
        clip-path: inset(0 0 0 0);
        opacity: 0.75;
    }
    100% {
        clip-path: inset(0 45% 0 45%);
        opacity: 0.4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-divider {
        animation: none;
        clip-path: inset(0 0 0 0);
        opacity: 0.7;
    }
}

/* =====================
   PAGE: ADMIN
===================== */
body.page-admin {
    align-items: flex-start;
    padding-top: 60px;
}

body.page-admin-home {
    align-items: flex-start;
    padding-top: 80px;
}

.admin-container {
    max-width: 900px;
    width: 100%;
    padding: 0 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.admin-card {
    background: var(--ndl-card);
    padding: 22px;
    border-radius: 12px;
    border-left: 4px solid var(--ndl-blue);
    color: #fff;
    text-decoration: none;
}

.admin-card:hover {
    border-left-color: var(--ndl-purple);
}

.ndl-card.ndl-card-spaced {
    margin-bottom: 30px;
}

.admin-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.admin-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.admin-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-meta-label {
    font-size: 14px;
    opacity: .75;
}

.admin-logout {
    font-size: 14px;
    color: var(--ndl-blue);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
}

.admin-footer {
    margin-top: 40px;
    padding-top: 20px;
    margin-bottom: 50px;
    border-top: 1px solid #2a2d3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    opacity: .85;
}

.admin-project-create-form {
    display: grid;
    grid-template-columns: 2fr 1.5fr 3fr auto;
    gap: 14px;
    align-items: start;
}

.admin-permissions-form {
    display: grid;
    grid-template-columns: 2fr 2fr auto auto;
    gap: 14px;
    align-items: end;
}

.admin-user-create-form {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr auto;
    gap: 12px;
    align-items: start;
}

.label-spacer {
    visibility: hidden;
}

.btn-full {
    width: 100%;
}

.form-align-end {
    align-self: end;
}

.btn-compact {
    padding: 4px 10px;
    font-size: 13px;
}

.btn-danger-dark {
    background: #3a1111;
}

.btn-danger-wide {
    grid-column: 1 / -1;
    background: #4a1515;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table.admin-table-projects thead tr {
    border-bottom: 2px solid rgba(255,255,255,.1);
}

.admin-table.admin-table-projects thead th {
    padding-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(230,230,230,.45);
}

.admin-table.admin-table-projects tbody tr {
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.admin-table.admin-table-projects tbody tr:last-child {
    border-bottom: none;
}

.admin-table.admin-table-projects tbody td {
    padding: 12px 8px 12px 0;
}

.admin-table.admin-table-users thead tr {
    border-bottom: 2px solid rgba(255,255,255,.1);
}

.admin-table.admin-table-users thead th {
    padding-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(230,230,230,.45);
}

.admin-table.admin-table-users tbody tr {
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.admin-table.admin-table-users tbody tr:last-child {
    border-bottom: none;
}

.admin-table.admin-table-users tbody td {
    padding: 12px 8px 12px 0;
}

.project-rename-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 240px;
}

.project-rename-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-actions {
    display: inline-flex;
    gap: 6px;
}

.status-active {
    color: #0f0;
}

.status-disabled {
    color: #aaa;
}

.status-locked {
    color: #f55;
}

.status-immune {
    color: #0f0;
}

.user-actions-grid {
    display: grid;
    grid-template-columns: auto auto;
    gap: 6px 8px;
}

.admin-audit-card {
    max-width: 1000px;
}

/* =====================
   PAGE: HOURS TRACKER
===================== */
.hours-alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 14px;
}

.hours-alert-success {
    background: rgba(2, 137, 171, 0.16);
    border-left: 4px solid var(--ndl-blue);
}

.hours-alert-error {
    background: rgba(171, 52, 2, 0.2);
    border-left: 4px solid var(--ndl-orange);
}

.hours-grid {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hours-entry-form {
    display: grid;
    grid-template-columns: 1.3fr 2fr 1fr 2fr auto;
    gap: 12px;
    align-items: start;
}

.hours-project-form {
    display: grid;
    grid-template-columns: 2fr auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 18px;
}

.hours-month-form {
    display: grid;
    grid-template-columns: 1.3fr auto auto auto;
    gap: 12px;
    align-items: start;
}

.hours-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 2px 0 16px;
}

.hours-month-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.hours-month-arrow {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    background: #0e1016;
    font-weight: 700;
}

.hours-month-arrow:hover {
    background: #151823;
}

.hours-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.hours-kpi {
    background: #0e1016;
    border: 1px solid #2a2d3a;
    border-radius: 10px;
    padding: 12px;
}

.hours-kpi span {
    display: block;
    font-size: 12px;
    opacity: .7;
    margin-bottom: 6px;
}

.hours-kpi strong {
    font-size: 20px;
}

.hours-monthly-breakdown tbody tr {
    border-bottom: 1px solid #1f2230;
}

.hours-project-table tbody tr {
    border-bottom: 1px solid #222;
}

.hours-muted {
    opacity: .7;
    margin-left: 6px;
}

.hours-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    background: #0e1016;
    color: #fff;
    font-weight: 600;
}

.hours-link-btn:hover {
    background: #151823;
}

.hours-calendar-table th,
.hours-calendar-table td {
    border: 1px solid #2a2d3a;
    vertical-align: top;
}

.hours-calendar-day {
    min-height: 120px;
    padding: 8px;
    cursor: pointer;
}

.hours-calendar-day:hover {
    background: rgba(2, 137, 171, 0.12);
}

.hours-calendar-empty {
    background: rgba(0, 0, 0, 0.15);
}

.hours-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hours-day-total {
    font-size: 12px;
    color: var(--ndl-blue);
}

.hours-calendar-entry {
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 5px;
    opacity: .92;
}

.hours-calendar-none {
    font-size: 12px;
    opacity: .55;
}

.hours-rename-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hours-rename-form input {
    margin-bottom: 0;
}

.hours-rename-form button {
    width: auto;
    white-space: nowrap;
}

.hours-entry-input {
    margin-bottom: 0;
}

.hours-entry-actions {
    min-width: 150px;
}

.hours-entry-edit-form {
    display: inline-flex;
    gap: 8px;
}

#hours-month-sections.hours-sections-loading {
    opacity: .6;
    pointer-events: none;
    transition: opacity .15s ease;
}

body.hours-modal-open {
    overflow: hidden;
}

.hours-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 5000;
}

.hours-modal.open {
    display: block;
}

.hours-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.hours-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100% - 24px));
    margin: 6vh auto 0;
    background: var(--ndl-card);
    border: 1px solid #2a2d3a;
    border-top: 4px solid var(--ndl-blue);
    border-radius: 12px;
    padding: 20px;
}

.hours-modal-dialog h2 {
    margin-top: 0;
}

.hours-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #0e1016;
    line-height: 1;
    font-size: 20px;
}

.hours-modal-form {
    display: grid;
    gap: 10px;
}

.hours-modal-form input,
.hours-modal-form .ndl-select {
    margin-bottom: 0;
}

/* =====================
   UTILITIES
===================== */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.link-ndl-blue {
    color: var(--ndl-blue);
}

.text-danger {
    color: #f55;
}

.text-success {
    color: #0f0;
}

/* =====================
   ADMIN NAV
===================== */
a[href="/logout.php"]:hover {
    background: rgba(2, 137, 171, 0.15);
}

.ndl-admin-nav {
    margin-bottom: 30px;
}

.ndl-nav-toggle {
    display: none;
    background: #0e1016;
    border: none;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.ndl-nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ndl-admin-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #cfd3ff;
    background: #0e1016;
    font-weight: 500;
}

.ndl-admin-nav a:hover {
    background: #151823;
}

.ndl-admin-nav a.active {
    background: linear-gradient(
        135deg,
        var(--ndl-orange),
        var(--ndl-purple)
    );
    color: #fff;
}

.ndl-admin-nav .icon {
    font-size: 16px;
}

/* =====================
   MOBILE BEHAVIOR
===================== */
@media (max-width: 768px) {
    .ndl-nav-toggle {
        display: inline-block;
        margin-bottom: 10px;
    }

    .ndl-nav-links {
        display: none;
        flex-direction: column;
        gap: 8px;
    }

    .ndl-admin-nav.open .ndl-nav-links {
        display: flex;
    }

    .hours-grid {
        grid-template-columns: 1fr;
    }

    .hours-entry-form,
    .hours-project-form,
    .hours-month-form {
        grid-template-columns: 1fr;
    }

    .hours-kpi-grid {
        grid-template-columns: 1fr;
    }

    .hours-rename-form {
        flex-direction: column;
        align-items: stretch;
    }

    .hours-entry-edit-form {
        flex-direction: column;
        width: 100%;
    }
}

/* =====================
   PAGE: MAINTENANCE
===================== */
.maintenance-card {
    text-align: center;
    max-width: 480px;
    width: 90%;
}
.maintenance-card h1 {
    padding-left: 0;
    font-size: 1.6rem;
}
.maintenance-card h1::before {
    display: none;
}
.maintenance-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.maintenance-title .accent-bar {
    display: inline-block;
    width: 4px;
    height: 28px;
    background: var(--ndl-orange);
    border-radius: 2px;
    flex-shrink: 0;
}
.maintenance-badge {
    display: inline-block;
    background: rgba(171,52,2,.15);
    border: 1px solid rgba(171,52,2,.4);
    color: #e06030;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}
.maintenance-message {
    color: rgba(230,230,230,.7);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}
.maintenance-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 24px 0;
}
.maintenance-footer {
    font-size: 12px;
    color: rgba(230,230,230,.35);
    letter-spacing: .04em;
}
.maintenance-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--ndl-blue);
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--ndl-blue);
    border-radius: 50%;
    animation: pulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.7); }
}

/* =====================
   ADMIN SIDEBAR LAYOUT
===================== */
body.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--ndl-bg);
    align-items: stretch;
    justify-content: flex-start;
    color: var(--ndl-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
}

/* Sidebar */
.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #0c0e15;
    border-right: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-sidebar-logo {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.admin-sidebar-logo a { display: block; }

.admin-sidebar-logo img {
    max-height: 52px;
    width: auto;
    display: block;
}

.admin-nav {
    flex: 1;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.admin-nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(230,230,230,.25);
    padding: 14px 20px 4px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(230,230,230,.55);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .12s, color .12s;
    white-space: nowrap;
    border-right: 3px solid transparent;
}

.admin-nav-link:hover {
    background: rgba(255,255,255,.04);
    color: rgba(230,230,230,.9);
}

.admin-nav-link.is-active {
    background: rgba(171,52,2,.12);
    color: #d0531f;
    border-right-color: var(--ndl-orange);
}

.admin-nav-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.admin-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.admin-role-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(230,230,230,.28);
    margin-bottom: 10px;
}

.admin-logout-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(230,230,230,.45);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    margin: 0 -10px;
    transition: background .12s, color .12s;
}

.admin-logout-link:hover {
    background: rgba(255,255,255,.05);
    color: rgba(230,230,230,.85);
}

/* Main area */
.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(0,0,0,.14);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.admin-page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -.01em;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-topbar-link {
    font-size: 13px;
    color: rgba(230,230,230,.4);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.admin-topbar-link:hover {
    color: var(--ndl-blue);
    border-color: rgba(2,137,171,.35);
}

.admin-content {
    padding: 32px;
    flex: 1;
}

/* Admin cards in new layout */
body.admin-layout .ndl-card {
    max-width: 100%;
}

body.admin-layout .admin-audit-card {
    max-width: 100%;
}

/* Mobile sidebar collapses to icon rail */
@media (max-width: 900px) {
    .admin-sidebar { width: 56px; }
    .admin-sidebar-logo img { max-height: 32px; }
    .admin-sidebar-logo { padding: 12px; }
    .admin-nav-link { padding: 12px 0; justify-content: center; border-right: none; }
    .admin-nav-link.is-active { border-right: none; background: rgba(171,52,2,.15); }
    .admin-nav-link span:not(.admin-nav-icon) { display: none; }
    .admin-nav-icon { width: auto; font-size: 18px; }
    .admin-nav-section { display: none; }
    .admin-sidebar-footer { padding: 10px 0; }
    .admin-role-label { display: none; }
    .admin-logout-link { justify-content: center; padding: 10px 0; margin: 0; border-radius: 0; }
    .admin-logout-link span { display: none; }
    .admin-content { padding: 20px; }
    .admin-topbar { padding: 14px 20px; }
}

/* =====================
   SETTINGS PAGE
===================== */
.settings-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(230,230,230,.35);
    margin: 0 0 16px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.settings-row:last-of-type { border-bottom: none; }

.settings-label { font-weight: 500; font-size: 15px; }

.settings-desc {
    font-size: 13px;
    color: rgba(230,230,230,.5);
    margin-top: 4px;
    line-height: 1.5;
}

.settings-badge-on {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(171,52,2,.18);
    border: 1px solid rgba(171,52,2,.4);
    color: #e06030;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 11px;
    border-radius: 20px;
    margin-top: 8px;
}

.settings-badge-off {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(2,137,171,.12);
    border: 1px solid rgba(2,137,171,.3);
    color: var(--ndl-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 11px;
    border-radius: 20px;
    margin-top: 8px;
}

.settings-toggle-btn { white-space: nowrap; flex-shrink: 0; }
.settings-toggle-btn button { width: auto; padding: 10px 20px; }

.whitelist-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.whitelist-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: 14px;
}

.whitelist-table tr:last-child td { border-bottom: none; }

.whitelist-table .ip-cell {
    font-family: 'Courier New', monospace;
    color: var(--ndl-blue);
}

.you-badge {
    display: inline-block;
    background: rgba(2,137,171,.12);
    border: 1px solid rgba(2,137,171,.25);
    color: var(--ndl-blue);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
}

.whitelist-add-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.whitelist-add-form input {
    margin-bottom: 0;
    font-family: 'Courier New', monospace;
    flex: 1;
}

.whitelist-add-form button {
    width: auto;
    white-space: nowrap;
    padding: 12px 20px;
}

.whitelist-empty {
    font-size: 14px;
    color: rgba(230,230,230,.35);
    margin-top: 14px;
    font-style: italic;
}

.your-ip-hint {
    font-size: 13px;
    color: rgba(230,230,230,.4);
    margin-top: 10px;
}

.your-ip-hint code {
    color: var(--ndl-blue);
    font-family: 'Courier New', monospace;
    background: rgba(2,137,171,.1);
    padding: 1px 6px;
    border-radius: 4px;
}

/* =====================
   MESSAGES PAGE
===================== */
.msg-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.msg-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: #0e1016;
    color: rgba(230,230,230,.65);
    border: 1px solid rgba(255,255,255,.07);
    transition: background .15s;
}

.msg-filter-btn:hover { background: #151823; color: rgba(230,230,230,.9); }

.msg-filter-btn.active {
    background: linear-gradient(135deg, var(--ndl-blue), var(--ndl-purple));
    color: #fff;
    border-color: transparent;
}

.msg-count-badge {
    background: rgba(255,255,255,.15);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

.msg-card {
    background: var(--ndl-card);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.06);
    margin-bottom: 14px;
    overflow: hidden;
}

.msg-card.status-new    { border-left: 4px solid var(--ndl-blue); }
.msg-card.status-read   { border-left: 4px solid rgba(255,255,255,.12); }
.msg-card.status-replied{ border-left: 4px solid var(--ndl-orange); }

.msg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
}

.msg-header:hover { background: rgba(255,255,255,.02); }

.msg-from { font-weight: 600; font-size: 15px; margin-bottom: 3px; }

.msg-email {
    font-size: 13px;
    color: var(--ndl-blue);
    text-decoration: none;
}

.msg-subject { font-size: 13px; color: rgba(230,230,230,.5); margin-top: 3px; }

.msg-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.msg-date { font-size: 12px; color: rgba(230,230,230,.3); }

.msg-status-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 10px;
}

.badge-new     { background: rgba(2,137,171,.18); color: var(--ndl-blue); }
.badge-read    { background: rgba(255,255,255,.07); color: rgba(230,230,230,.45); }
.badge-replied { background: rgba(171,52,2,.18); color: #e06030; }

.msg-body { display: none; padding: 0 20px 20px; border-top: 1px solid rgba(255,255,255,.05); }
.msg-body.open { display: block; }

.msg-text {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(230,230,230,.8);
    white-space: pre-wrap;
    background: #0e1016;
    border-radius: 8px;
    padding: 14px;
    margin: 14px 0;
    font-family: inherit;
}

.msg-reply-note {
    font-size: 13px;
    color: rgba(230,230,230,.55);
    background: rgba(171,52,2,.08);
    border-left: 3px solid var(--ndl-orange);
    padding: 10px 12px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 14px;
}

.msg-reply-note strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ndl-orange);
    margin-bottom: 4px;
}

.msg-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.msg-actions form { display: contents; }

.msg-actions button,
.msg-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: inherit;
    transition: opacity .15s;
}

.msg-actions button:hover,
.msg-reply-link:hover { opacity: .8; }

.btn-mark-read  { background: rgba(2,137,171,.15); color: var(--ndl-blue); }
.btn-delete     { background: rgba(171,52,2,.15); color: #e06030; }
.msg-reply-link { background: linear-gradient(135deg, var(--ndl-blue), var(--ndl-purple)); color: #fff; }

.reply-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.reply-form textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: #0e1016;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.reply-form textarea:focus { outline: none; border-color: var(--ndl-orange); }

.btn-mark-replied {
    background: rgba(171,52,2,.2);
    color: #e06030;
    width: auto;
    font-family: inherit;
}

.msg-empty {
    text-align: center;
    color: rgba(230,230,230,.3);
    padding: 48px 20px;
    font-size: 14px;
}

.msg-ip { font-size: 12px; color: rgba(230,230,230,.28); margin-top: 6px; }

/* =====================
   ADMIN DASHBOARD
===================== */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.dash-stat {
    background: var(--ndl-card);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.06);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: var(--ndl-text);
    transition: transform .15s, box-shadow .15s;
}

.dash-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.35);
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.dsi-blue   { background: rgba(2,137,171,.14); }
.dsi-purple { background: rgba(103,2,171,.14); }
.dsi-orange { background: rgba(171,52,2,.14); }

.dash-stat-body {}

.dash-stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -.02em;
}

.dsv-blue   { color: var(--ndl-blue); }
.dsv-purple { color: var(--ndl-purple); }
.dsv-orange { color: var(--ndl-orange); }

.dash-stat-label {
    font-size: 12px;
    color: rgba(230,230,230,.45);
    font-weight: 500;
    letter-spacing: .03em;
}

.dash-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dash-panel {
    background: var(--ndl-card);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
}

.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.dash-panel-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(230,230,230,.5);
}

.dash-panel-link {
    font-size: 12px;
    color: var(--ndl-blue);
    text-decoration: none;
    opacity: .8;
    transition: opacity .15s;
}

.dash-panel-link:hover { opacity: 1; }

.dash-msg-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    text-decoration: none;
    color: var(--ndl-text);
    transition: background .12s;
}

.dash-msg-item:last-child { border-bottom: none; }
.dash-msg-item:hover { background: rgba(255,255,255,.025); }

.dash-msg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.dmd-new     { background: var(--ndl-blue); }
.dmd-read    { background: rgba(255,255,255,.2); }
.dmd-replied { background: var(--ndl-orange); }

.dash-msg-from {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.dash-msg-subject {
    font-size: 13px;
    color: rgba(230,230,230,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.dash-msg-time {
    font-size: 11px;
    color: rgba(230,230,230,.3);
    margin-top: 3px;
}

.dash-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 20px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}

.dash-activity-item:last-child { border-bottom: none; }

.dash-activity-action {
    font-size: 13px;
    font-weight: 500;
    color: rgba(230,230,230,.75);
}

.dash-activity-user {
    font-size: 12px;
    color: rgba(230,230,230,.35);
    margin-top: 2px;
}

.dash-activity-time {
    font-size: 11px;
    color: rgba(230,230,230,.25);
    margin-left: auto;
    flex-shrink: 0;
    padding-top: 1px;
}

.dash-empty {
    padding: 32px 20px;
    text-align: center;
    font-size: 13px;
    color: rgba(230,230,230,.3);
}

@media (max-width: 900px) {
    .dash-stats   { grid-template-columns: 1fr; }
    .dash-columns { grid-template-columns: 1fr; }
}

.btn-delete-red {
    background: rgba(180,30,30,.15);
    color: #e05555;
    border: 1px solid rgba(180,30,30,.3);
}

.btn-delete-red:hover {
    background: rgba(180,30,30,.28);
}
