
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg: #f3f6f4;
    --ink: #102019;
    --muted: #65766e;
    --line: #d7e0dc;
    --dark: #07110e;
    --acid: #9cf55f;
    --panel: #fff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* Admin Layout */
.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 245px 1fr;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    background: var(--dark);
    color: white;
    padding: 24px 17px;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.admin-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    font: 700 18px 'Space Grotesk';
    padding: 0 7px 26px;
}

.admin-brand small {
    color: #9bb2a8;
    font-size: 10px;
    letter-spacing: .16em;
}

.brand-mark {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--acid), #5cecf7);
    color: #07110e;
    font: 800 18px 'Space Grotesk';
    transform: skew(-7deg);
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-sidebar nav a {
    padding: 11px 12px;
    border-radius: 7px;
    color: #bad0c6;
}

.admin-sidebar nav a:hover {
    background: #10231d;
    color: white;
}

.sidebar-user {
    margin-top: auto;
    padding: 14px 10px;
    border-top: 1px solid #1c342b;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-user a {
    font-size: 12px;
    color: #9bb2a8;
}

.admin-main {
    grid-column: 2;
    padding: 38px 42px;
    min-width: 0;
}

.mobile-admin-head {
    display: none;
}

/* Page Header */
.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.admin-head h1 {
    font: 700 38px 'Space Grotesk';
    letter-spacing: -.035em;
    margin: 4px 0;
}

.admin-head p {
    color: var(--muted);
    margin: 0;
}

.overline {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    color: #328b65;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    padding: 10px 15px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 700;
}

.btn.primary {
    background: var(--dark);
    border-color: var(--dark);
    color: white;
}

.btn.mini {
    padding: 6px 9px;
    font-size: 11px;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
}

.stat span {
    color: var(--muted);
    font-size: 12px;
}

.stat strong {
    display: block;
    font: 700 38px 'Space Grotesk';
    margin-top: 7px;
}

.stat small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
}

.stat small a {
    font-weight: 700;
    color: #328b65;
}

/* Panels */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
}

.panel h2,
.panel h3 {
    font-family: 'Space Grotesk';
    margin-top: 0;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-head a {
    font-size: 13px;
    font-weight: 700;
}

.panel-sub {
    margin: -8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

/* Tables */
.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 11px;
    border-bottom: 1px solid #e8eeeb;
    font-size: 13px;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.table-actions form {
    margin: 0;
}

/* Status Labels */
.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 99px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
}

.status.published {
    background: #e3f8e7;
    color: #23683d;
}

.status.draft {
    background: #f2eee5;
    color: #805e1a;
}

.text-danger {
    border: 0;
    background: none;
    color: #b13b3b;
    cursor: pointer;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.filters input {
    min-width: 280px;
}

.filters input,
.filters select,
label input,
label textarea,
label select {
    border: 1px solid var(--line);
    background: white;
    padding: 11px 12px;
    border-radius: 7px;
}

/* Forms */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-stack label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.form-stack input,
.form-stack textarea,
.form-stack select {
    width: 100%;
}

.form-stack small {
    font-weight: 400;
    color: var(--muted);
}

.check {
    flex-direction: row !important;
    align-items: center;
}

.check input {
    width: auto;
}

.form-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ad-active-check {
    min-height: 70px;
    justify-content: flex-start;
    padding-top: 31px;
}

#scopeValueLabel select,
#scopeValueLabel input {
    width: 100%;
}

/* Editor */
.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.sticky-actions {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(243, 246, 244, .92);
    backdrop-filter: blur(9px);
    padding: 10px 0;
}

.action-row {
    display: flex;
    gap: 8px;
}

.editor-toolbar {
    display: flex;
    gap: 5px;
    padding: 7px;
    background: #f5f7f6;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
}

.editor-toolbar button {
    border: 1px solid var(--line);
    background: white;
    border-radius: 4px;
    min-width: 34px;
    height: 30px;
    cursor: pointer;
}

.rich-editor {
    min-height: 480px;
    border: 1px solid var(--line);
    border-radius: 0 0 7px 7px;
    padding: 18px;
    font-family: Georgia, serif;
    font-size: 17px;
    line-height: 1.65;
    outline: none;
    font-weight: 400;
}

.admin-preview {
    width: 100%;
    max-height: 190px;
    object-fit: cover;
    border-radius: 7px;
    margin-bottom: 12px;
}

/* Settings */
.two-col {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 20px;
    align-items: start;
}

.settings-panel {
    max-width: 820px;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 7px;
    margin-bottom: 16px;
}

.alert.success {
    background: #ddf4e4;
    color: #205d37;
}

.alert.error {
    background: #fde5e5;
    color: #8e2929;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 20% 10%, #17372d, #07110e 50%);
    padding: 20px;
}

.login-card {
    width: min(430px, 100%);
    background: white;
    padding: 34px;
    border-radius: 16px;
    box-shadow: 0 30px 70px #0005;
}

.login-card .brand-mark {
    margin-bottom: 24px;
}

.login-card h1 {
    font: 700 34px 'Space Grotesk';
    margin: 0 0 8px;
}

.login-card > p {
    color: var(--muted);
    margin-bottom: 24px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}

.login-card input {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.login-card .btn {
    width: 100%;
    margin-top: 5px;
}

.back-link {
    display: block;
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted);
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
    gap: 20px;
    margin-bottom: 20px;
}

.range-links {
    display: flex;
    gap: 4px;
    background: #f0f4f2;
    padding: 3px;
    border-radius: 7px;
}

.range-links a {
    padding: 6px 9px;
    border-radius: 5px;
    font-size: 11px;
}

.range-links a.active {
    background: var(--dark);
    color: #fff;
}

.traffic-list {
    display: flex;
    flex-direction: column;
    margin-top: 17px;
}

.traffic-row {
    display: grid;
    grid-template-columns: 48px minmax(100px, 1fr) 55px 65px;
    align-items: center;
    gap: 10px;
    padding: 9px 7px;
    border-radius: 7px;
}

.traffic-row:hover,
.traffic-row.selected {
    background: #f4f8f6;
}

.traffic-date {
    font-size: 11px;
    color: var(--muted);
}

.traffic-bar-track {
    height: 9px;
    border-radius: 99px;
    background: #edf2ef;
    overflow: hidden;
}

.traffic-bar {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #2b9a6d, var(--acid));
}

.traffic-row strong {
    text-align: right;
    font-size: 12px;
}

.traffic-row small {
    font-size: 10px;
    color: var(--muted);
    text-align: right;
}

.date-form {
    display: flex;
    gap: 7px;
    align-items: center;
}

.date-form input {
    border: 1px solid var(--line);
    background: white;
    padding: 8px 9px;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
}

.empty-state {
    padding: 32px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* Advertising */
.ad-global-panel,
.ad-list-panel {
    margin-bottom: 20px;
}

.code-note {
    padding: 11px 13px;
    background: #f4f8f6;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

/* Privacy */
.privacy-note {
    margin-top: 0;
}

.privacy-note h3 {
    margin-bottom: 6px;
}

.privacy-note p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    max-width: 900px;
}

/* Responsive: Tablets and smaller desktops */
@media (max-width: 1100px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: .2s;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        padding: 18px;
    }

    .mobile-admin-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--dark);
        color: white;
        margin: -18px -18px 22px;
        padding: 14px 18px;
    }

    .mobile-admin-head button {
        background: none;
        border: 0;
        color: white;
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .editor-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .sticky-actions {
        top: 0;
    }

    .admin-head {
        align-items: flex-start;
    }

    .admin-head h1 {
        font-size: 31px;
    }
}

/* Responsive: Mobile phones */
@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-head {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
    }

    .filters input {
        min-width: 0;
    }

    .form-split {
        grid-template-columns: 1fr;
    }

    .editor-grid {
        display: block;
    }

    .editor-grid > aside {
        margin-top: 16px;
    }

    .traffic-row {
        grid-template-columns: 42px minmax(75px, 1fr) 42px;
    }

    .traffic-row small {
        display: none;
    }

    .panel-head {
        gap: 10px;
        align-items: flex-start;
    }

    .date-form {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .analytics-stats {
        grid-template-columns: 1fr 1fr;
    }
    .rich-editor *{font-weight:400;font-style:normal}
.rich-editor h2,.rich-editor h3{font-weight:700}
.rich-editor em,.rich-editor i{font-style:italic}
}
