:root {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #203247;
    background: #f4f6f8;
    font-synthesis: none;
    line-height: 1.5
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

button,
input,
textarea,
select {
    font: inherit
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent
}

button {
    cursor: pointer
}

button:disabled {
    opacity: .55;
    cursor: wait
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #c48820;
    outline-offset: 3px
}

a {
    color: #174678
}

h1,
h2,
h3,
p {
    margin-top: 0
}

h1 {
    font-size: 30px;
    letter-spacing: -1px;
    line-height: 1.2
}

h2 {
    font-size: 21px;
    letter-spacing: -.4px
}

h3 {
    font-size: 16px
}

small,
.muted {
    color: #657386
}

.shell {
    display: grid;
    grid-template-columns: 235px 1fr;
    min-height: 100vh
}

.sidebar {
    background: #052244;
    color: white;
    padding: 32px 22px;
    display: flex;
    flex-direction: column;
    gap: 28px
}

.brand {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px
}

.brand span {
    color: #dfa842
}

.brand small {
    display: block;
    color: #a6b7cb;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 400;
    margin-top: 4px
}

.sidebar nav {
    display: grid;
    gap: 8px
}

.sidebar button {
    border: 0;
    background: transparent;
    color: #c0cede;
    text-align: left;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 500
}

.sidebar button.active,
.sidebar button:hover {
    background: #193a5e;
    color: white
}

.sidebar .logout {
    margin-top: auto
}

.workspace {
    padding: 42px;
    max-width: 1400px;
    width: 100%;
    min-width: 0
}

.topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
    font-weight: 600;
    color: #9b6819;
    margin-bottom: 8px
}

.btn {
    border: 1px solid #d6dde4;
    background: white;
    color: #203247;
    border-radius: 7px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    gap: 8px
}

.btn:hover {
    background: #f0f3f6
}

.btn.primary {
    background: #052244;
    color: white;
    border-color: #052244
}

.btn.primary:hover {
    background: #16416e
}

.btn.danger {
    color: #af2532;
    border-color: #edc9cc;
    background: #fff8f8
}

.btn.small {
    font-size: 12px;
    padding: 7px 10px
}

.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px
}

.card {
    background: white;
    border: 1px solid #e0e5eb;
    border-radius: 12px;
    padding: 26px;
    box-shadow: 0 3px 10px #05224403
}

.stat {
    font-size: 44px;
    font-weight: 600;
    line-height: 1.3;
    margin: 12px 0
}

.stat-note {
    display: flex;
    gap: 20px;
    color: #657386;
    font-size: 13px
}

.help {
    margin-top: 24px
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: end
}

.toolbar label {
    flex: 1;
    min-width: 140px
}

.toolbar label:first-child {
    flex: 2;
    min-width: 210px
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #354559
}

input,
textarea,
select {
    display: block;
    width: 100%;
    border: 1px solid #cfd8e2;
    border-radius: 7px;
    padding: 11px 12px;
    background: white;
    color: #203247;
    margin-top: 7px;
    font-weight: 400;
    font-size: 14px
}

textarea {
    resize: vertical;
    min-height: 150px
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #c48820;
    outline-offset: 1px
}

.table-wrap {
    overflow: auto;
    border: 1px solid #e0e5eb;
    border-radius: 10px;
    background: white
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px
}

th {
    background: #fafbfc;
    color: #657386;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px
}

td {
    padding: 18px 20px;
    border-top: 1px solid #edf0f3
}

td:first-child {
    min-width: 230px;
    font-weight: 600
}

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

.thumb {
    width: 54px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    background: #eef1f4
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 210px
}

.badge {
    display: inline-block;
    border-radius: 20px;
    padding: 4px 10px;
    background: #fff2d7;
    color: #8b5f15;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap
}

.badge.published {
    background: #e4f3ed;
    color: #216b50
}

.empty {
    padding: 60px 24px;
    text-align: center;
    color: #657386
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px
}

.form-grid .full {
    grid-column: 1/-1
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e5eb
}

.field-hint {
    font-size: 12px;
    color: #657386;
    font-weight: 400;
    margin: 7px 0 0
}

.upload-box {
    border: 1px dashed #bac8d7;
    background: #f9fbfd;
    padding: 20px;
    border-radius: 8px
}

.upload-box input {
    background: white
}

.image-grid {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 15px
}

.image-preview {
    width: 145px;
    position: relative
}

.image-preview img {
    width: 145px;
    height: 104px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid #e0e5eb
}

.image-preview button {
    width: 100%;
    margin-top: 4px
}

.error {
    color: #a92231;
    background: #fff0f1;
    padding: 12px 15px;
    border-radius: 7px;
    margin-bottom: 18px
}

.error:empty {
    display: none
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(145deg, #052244, #143d65)
}

.login .card {
    width: 100%;
    max-width: 420px;
    padding: 38px
}

.login .brand {
    color: #052244;
    margin-bottom: 32px
}

.login label {
    margin: 18px 0
}

.login .btn {
    width: 100%;
    margin-top: 12px
}

.loading {
    padding: 40px
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #edf2f7;
    border: 0;
    border-radius: 20px;
    padding: 5px 10px;
    color: #34516e;
    font-size: 12px
}

#notice:not(:empty) {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: min(440px, calc(100vw - 48px));
    background: #052244;
    color: white;
    border-radius: 9px;
    padding: 15px 22px;
    box-shadow: 0 8px 24px #05224430;
    z-index: 20
}

dialog {
    border: 0;
    border-radius: 14px;
    padding: 30px;
    max-width: 440px;
    width: calc(100% - 40px);
    box-shadow: 0 20px 60px #0003
}

dialog::backdrop {
    background: #05224488
}

dialog .actions {
    justify-content: flex-end;
    margin-top: 25px
}

.check {
    display: flex;
    align-items: center;
    gap: 10px
}

.check input {
    width: auto;
    margin: 0
}

.save-note {
    margin-right: auto;
    color: #657386;
    font-size: 12px
}

.section-label {
    margin: 8px 0 -5px;
    padding-top: 22px;
    border-top: 1px solid #e0e5eb
}

details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 20px
}

.count {
    font-size: 13px;
    color: #657386;
    margin-bottom: 12px
}

@media(max-width:950px) {
    .shell {
        grid-template-columns: 185px 1fr
    }

    .workspace {
        padding: 26px
    }

    .sidebar {
        padding: 28px 16px
    }

    .cards {
        gap: 14px
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .form-grid .full {
        grid-column: auto
    }
}

@media(max-width:650px) {
    .shell {
        display: block
    }

    .sidebar {
        padding: 18px 20px;
        gap: 14px
    }

    .brand {
        font-size: 23px
    }

    .sidebar nav {
        display: flex;
        gap: 5px;
        flex-wrap: wrap
    }

    .sidebar button {
        padding: 8px 10px;
        font-size: 13px
    }

    .sidebar .logout {
        position: absolute;
        right: 16px;
        top: 22px
    }

    .workspace {
        padding: 26px 18px
    }

    .cards {
        grid-template-columns: 1fr
    }

    .topline {
        align-items: flex-start
    }

    .topline h1 {
        font-size: 26px
    }

    .card {
        padding: 20px
    }

    .form-actions {
        flex-wrap: wrap
    }

    .save-note {
        width: 100%
    }

    .toolbar {
        gap: 10px
    }

    .toolbar label {
        min-width: 120px
    }

    .login .card {
        padding: 28px
    }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 140px;
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  box-sizing: border-box;
}