:root {
    --brand-red: #d9131a;
    --brand-red-dark: #9f0d12;
    --brand-white: #ffffff;
    --brand-silver: #e7e7e7;
    --brand-gray: #b8b8b8;
    --ink: #211d1d;
    --muted: #5e5555;
    --line: #d9cdcd;
    --card: rgba(255, 255, 255, 0.86);
    --card-strong: #ffffff;
    --radius: 18px;
    --shadow-soft: 0 20px 40px rgba(120, 21, 23, 0.12);
    --shadow-strong: 0 28px 60px rgba(120, 21, 23, 0.22);
    --typo-table-row-size: 0.97rem;
    --typo-popup-label-size: 0.78rem;
    --typo-popup-value-size: 1.12rem;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Montserrat", "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 40%, #ececec 100%);
    overflow-x: hidden;
}

#bg-pattern {
    position: fixed;
    inset: 0;
    z-index: -3;
    opacity: 0.2;
    background-color: #f3f3f3;
    background-image:
        linear-gradient(30deg, transparent 75%, #c7c7c7 75%),
        linear-gradient(-30deg, transparent 75%, #d8d8d8 75%);
    background-size: 160px 138px;
    background-position: 0 0, 80px 69px;
    animation: patternShift 26s linear infinite;
}

#bg-orb-a,
#bg-orb-b {
    position: fixed;
    width: 38vw;
    max-width: 560px;
    aspect-ratio: 1;
    border-radius: 999px;
    filter: blur(70px);
    z-index: -2;
    pointer-events: none;
}

#bg-orb-a {
    top: -12vh;
    left: -12vw;
    background: radial-gradient(circle, rgba(217, 19, 26, 0.28) 0%, rgba(217, 19, 26, 0) 70%);
    animation: floatA 8s ease-in-out infinite alternate;
}

#bg-orb-b {
    right: -14vw;
    bottom: -18vh;
    background: radial-gradient(circle, rgba(140, 10, 16, 0.22) 0%, rgba(140, 10, 16, 0) 72%);
    animation: floatB 10s ease-in-out infinite alternate;
}

.layout {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px;
}

.hidden {
    display: none !important;
}

.card {
    border-radius: var(--radius);
    border: 1px solid #dcc8c8;
    background: linear-gradient(160deg, var(--card), rgba(255, 255, 255, 0.95));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: "Bebas Neue", "Montserrat", sans-serif;
    letter-spacing: 0.04em;
    color: #2a1718;
}

h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

h2 {
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

h3 {
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

h4 {
    font-size: 1.2rem;
}

.muted {
    color: var(--muted);
}

.brand-line {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe0e1, #fff0f0);
    border: 1px solid #f1b7b9;
    color: #8d1217;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-card {
    max-width: 520px;
    margin: 7vh auto;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.login-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
}

.login-logo-wrap img {
    max-height: 190px;
    max-width: 460px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(117, 17, 21, 0.22));
}

.login-card::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 170px;
    height: 170px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(217, 19, 26, 0.22), rgba(217, 19, 26, 0.03));
    transform: rotate(18deg);
    pointer-events: none;
}

form {
    display: block;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

#login-form label {
    margin-top: 0;
}

#login-form button {
    align-self: flex-start;
    margin-top: 2px;
    min-width: 150px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    font-weight: 700;
    color: #382f2f;
}

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

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cebcbc;
    border-radius: 11px;
    padding: 11px 12px;
    background: #fff;
    color: #2a1f1f;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #ce5359;
    box-shadow: 0 0 0 4px rgba(217, 19, 26, 0.14);
    transform: translateY(-1px);
}

button {
    border: none;
    border-radius: 11px;
    padding: 10px 14px;
    background: linear-gradient(140deg, var(--brand-red), var(--brand-red-dark));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 10px 20px rgba(157, 13, 18, 0.28);
}

button:hover {
    transform: translateY(-1px);
    filter: saturate(1.08);
}

button:active {
    transform: translateY(1px);
}

button.ghost {
    background: rgba(255, 255, 255, 0.78);
    color: #6a1d21;
    border: 1px solid #d8b2b4;
    box-shadow: none;
}

.info {
    margin-top: 14px;
    color: #7a6667;
}

@media (max-width: 560px) {
    #login-form button {
        width: 100%;
        min-width: 0;
    }
}

#app-view {
    animation: fadeIn 0.38s ease;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 20px 22px;
    border-top: 4px solid var(--brand-red);
    position: relative;
    overflow: hidden;
}

.topbar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(217, 19, 26, 0.08) 45%, transparent 65%);
    transform: translateX(-100%);
    animation: shimmer 4.8s ease-in-out infinite;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1;
}

.topbar-logo-wrap {
    width: 170px;
    height: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: none;
}

.topbar-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chip {
    background: linear-gradient(135deg, #ffe8e9, #fff);
    color: #831116;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid #efb4b7;
    font-weight: 700;
}

.hero-image-wrap {
    margin-top: 16px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid #d9c4c4;
    box-shadow: var(--shadow-soft);
}

.hero-image-wrap img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
    transform: scale(1.01);
}

.grid-nav {
    margin-top: 16px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.nav-btn {
    position: relative;
    text-align: left;
    background: linear-gradient(145deg, #d9131a, #a20d12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
}

.nav-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, 0.3) 50%, transparent 90%);
    transform: translateX(-120%);
    transition: transform 0.5s ease;
}

.nav-btn:hover::before {
    transform: translateX(120%);
}

.nav-btn.inactive {
    background: linear-gradient(145deg, #f7f2f2, #ece7e7);
    color: #533f3f;
    border: 1px solid #d9cbcb;
}

.panel {
    margin-top: 15px;
    padding: 18px;
    animation: panelIn 0.35s ease;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    padding: 24px;
    background: rgba(33, 16, 16, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 18px;
    border-top: 4px solid var(--brand-red);
    animation: panelIn 0.2s ease;
}

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

.section-head.compact {
    margin-top: 12px;
}

.stack {
    display: grid;
    gap: 10px;
}

.grid-two {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
}

.btn-row {
    display: flex;
    gap: 8px;
}

.data-search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.data-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.import-form {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #dfcdcd;
}

.data-manager-modal-card {
    width: min(1120px, 96vw);
    background:
        radial-gradient(1000px 240px at right top, rgba(217, 19, 26, 0.12), rgba(217, 19, 26, 0)),
        linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 242, 0.95));
}

.data-manager-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.modal-form-card {
    padding: 14px;
    border: 1px solid #e5d2d2;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 249, 249, 0.92));
    box-shadow: 0 12px 24px rgba(118, 28, 31, 0.08);
}

.modal-form-card h4 {
    margin-bottom: 6px;
}

.data-manager-grid .import-form {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    border-bottom: 1px solid #e2d7d7;
    text-align: left;
    padding: 10px 9px;
    vertical-align: top;
}

td {
    font-size: var(--typo-table-row-size);
}

th {
    color: #7f2c31;
    font-weight: 700;
    background: #fff7f7;
}

th .sort-btn {
    all: unset;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    font-weight: 700;
}

th .sort-btn:hover {
    text-decoration: underline;
}

tr:hover td {
    background: rgba(217, 19, 26, 0.04);
}

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

.tag-alert {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #ffe6e7;
    color: #8f1217;
    border: 1px solid #f0b2b4;
}

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

.table-info-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.table-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e0c9c9;
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(145deg, #fff, #f7f3f3);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.table-info-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(104, 28, 31, 0.14);
}

.table-info-row:focus-visible {
    outline: 3px solid rgba(206, 83, 89, 0.32);
    outline-offset: 1px;
}

.table-info-main p {
    margin: 3px 0 0;
}

#data-table-modal {
    padding: 16px 1.2vw;
    align-items: flex-start;
}

.data-table-modal-card {
    width: min(96vw, 1800px);
    max-height: calc(100vh - 32px);
    margin-top: 4px;
    border: 1px solid #d9c0c1;
    background:
        radial-gradient(1200px 220px at right top, rgba(217, 19, 26, 0.1), rgba(217, 19, 26, 0)),
        linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(250, 245, 245, 0.92));
    box-shadow: 0 26px 58px rgba(93, 18, 21, 0.24);
}

#data-table-modal .section-head {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: -18px -18px 12px;
    padding: 14px 18px;
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
    border-bottom: 1px solid #e3cece;
}

#data-table-modal .table-wrap {
    margin-top: 0;
    border: 1px solid #e3d0d0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

#data-table-modal table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

#data-table-modal th,
#data-table-modal td {
    white-space: nowrap;
}

#data-table-modal thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #fff6f6, #ffecec);
}

#data-table-modal tbody tr {
    transition: transform 0.14s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#data-table-modal tbody tr:nth-child(even) td {
    background: rgba(255, 250, 250, 0.82);
}

#data-table-modal tbody tr:hover td {
    background: linear-gradient(90deg, rgba(217, 19, 26, 0.08), rgba(255, 255, 255, 0.9));
}

#data-table-modal tbody tr:hover {
    transform: translateY(-1px);
}

#data-table-modal tbody tr[data-open-row] {
    cursor: pointer;
}

#data-table-modal td:last-child,
#data-table-modal th:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.75), rgba(255, 247, 247, 0.98));
    border-left: 1px solid #e6d5d5;
}

#data-table-modal th:last-child {
    z-index: 3;
}

.row-detail-modal-card {
    width: min(1240px, 96vw);
    max-height: calc(100vh - 16px);
    padding: 0;
    border: none;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 0 0 1px rgba(160, 40, 45, 0.12),
        0 48px 120px rgba(70, 10, 14, 0.42),
        0 12px 40px rgba(0, 0, 0, 0.22);
    animation: rowDetailIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}

@keyframes rowDetailIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.94);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.row-detail-grid {
    grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
    gap: 1px;
    align-items: start;
    padding: 24px 28px 28px;
    overflow: auto;
    background: #f2eaea;
    gap: 14px;
}

#row-detail-modal .section-head {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0;
    padding: 28px 32px 26px;
    background:
        radial-gradient(ellipse 70% 120% at 105% -10%, rgba(255, 90, 90, 0.35), transparent 60%),
        radial-gradient(ellipse 50% 80% at -10% 110%, rgba(180, 30, 40, 0.2), transparent 55%),
        linear-gradient(140deg, #180507 0%, #3d0b0f 45%, #640f15 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

#row-detail-title {
    font-size: clamp(1rem, 1.8vw, 1.45rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
    max-width: 70%;
    text-transform: uppercase;
}

#row-detail-modal .section-head .actions {
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

#row-detail-edit {
    background: #ffffff !important;
    color: #c0141a !important;
    border: none !important;
    font-weight: 800 !important;
    font-size: 0.88rem !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    border-radius: 50px !important;
    padding: 10px 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255,255,255,0);
    transition: transform 0.18s cubic-bezier(0.22,1,0.36,1), box-shadow 0.18s;
}

#row-detail-edit:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
}

#row-detail-save,
#row-detail-close {
    background: rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-radius: 50px !important;
    padding: 10px 24px !important;
    backdrop-filter: blur(10px);
    transition: background 0.18s, transform 0.18s cubic-bezier(0.22,1,0.36,1), box-shadow 0.18s;
}

#row-detail-save:hover,
#row-detail-close:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.row-detail-field {
    margin-top: 0;
    gap: 0;
    padding: 0;
    border: 1px solid rgba(180, 80, 88, 0.16);
    border-left: 3px solid #d91318;
    border-radius: 14px;
    background: #ffffff;
    box-shadow:
        0 2px 10px rgba(120, 20, 28, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
    width: 100%;
    font-size: var(--typo-popup-label-size);
    font-weight: 800;
    color: #c0141a;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    overflow: hidden;
    transition: box-shadow 0.2s cubic-bezier(0.22,1,0.36,1), transform 0.2s cubic-bezier(0.22,1,0.36,1), border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.row-detail-field:hover {
    box-shadow:
        0 8px 28px rgba(120, 20, 28, 0.13),
        0 3px 8px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
    border-left-color: #ff2d35;
}

.row-detail-field:has(textarea:focus) {
    border-left-color: #ff2d35;
    box-shadow:
        0 0 0 3px rgba(217, 19, 24, 0.12),
        0 8px 28px rgba(120, 20, 28, 0.12);
    transform: translateY(-1px);
}

.row-detail-field textarea {
    width: 100%;
    min-height: 48px;
    resize: vertical;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.55;
    border-radius: 0;
    padding: 6px 12px 10px;
    font-weight: 400;
    font-size: var(--typo-popup-value-size);
    color: #1c1212;
    border: none;
    border-top: 1px solid rgba(200, 150, 155, 0.18);
    background: transparent;
    box-shadow: none;
    outline: none;
    transition: background 0.15s;
    order: 2;
}

.row-detail-field textarea:focus {
    background: rgba(217, 19, 24, 0.022);
}

.row-detail-field textarea.read-only {
    background: transparent;
    color: #221616;
    border-top-color: rgba(200, 150, 155, 0.13);
    cursor: default;
    resize: none;
}

.row-detail-field-label {
    padding: 8px 12px 4px;
    order: 1;
    font-family: Arial, Helvetica, sans-serif;
}

.data-search-modal-card {
    width: min(1080px, 96vw);
    max-height: calc(100vh - 18px);
    background:
        radial-gradient(1000px 260px at right top, rgba(217, 19, 26, 0.12), rgba(217, 19, 26, 0)),
        linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 242, 0.95));
}

.search-results-grid {
    display: grid;
    gap: 12px;
}

.search-result-card {
    border: 1px solid #e5d1d1;
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 250, 250, 0.9));
    box-shadow: 0 10px 20px rgba(118, 28, 31, 0.08);
}

.search-result-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.search-result-type {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ffe6e7;
    color: #8f1217;
    border: 1px solid #efb5b8;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.search-result-source {
    margin: 0 0 10px;
    color: #735f5f;
}

.search-result-body {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.search-result-line {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 248, 248, 0.82);
    border: 1px solid #efdfdf;
}

.search-result-line span {
    color: #7b6868;
    font-size: 0.84rem;
    font-weight: 600;
}

.search-result-line strong {
    font-weight: 500;
    color: #2d2222;
    overflow-wrap: anywhere;
}

.result-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 900px) {
    .data-search-bar {
        grid-template-columns: 1fr;
    }

    .data-manager-grid {
        grid-template-columns: 1fr;
    }

    .row-detail-modal-card {
        width: 100%;
        max-height: 100vh;
        border-radius: 16px;
    }

    #row-detail-modal .section-head {
        padding: 20px;
    }

    #row-detail-title {
        max-width: 100%;
        font-size: 0.95rem;
    }

    .row-detail-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 10px;
    }
}

.list-item {
    border: 1px solid #e0c9c9;
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(145deg, #fff, #f7f3f3);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(104, 28, 31, 0.14);
}

.admin-tabs-nav {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e8d7d7;
}

.admin-tab-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    font-weight: 700;
    font-size: 0.9rem;
    color: #7a4a4c;
    cursor: pointer;
    transition: color 0.15s, border-bottom-color 0.15s;
    margin-bottom: -2px;
    letter-spacing: 0.02em;
}

.admin-tab-btn:hover {
    color: #d9131a;
}

.admin-tab-btn.active {
    color: #d9131a;
    border-bottom-color: #d9131a;
}

.admin-tab-panel {
    animation: panelIn 0.2s ease;
}

.typo-settings-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 16px;
}

.typo-label {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #4a3232;
}

.typo-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.typo-slider-wrap input[type="range"] {
    flex: 1;
    accent-color: #d9131a;
}

.typo-value-display {
    font-size: 0.9rem;
    font-weight: 700;
    color: #d9131a;
    min-width: 64px;
    text-align: right;
}

.stats-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 14px;
}

.stat-box {
    position: relative;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff, #f8f3f3);
    border: 1px solid #e7d2d2;
    overflow: hidden;
}

.stat-box::before {
    content: "";
    position: absolute;
    left: -20px;
    top: -20px;
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(217, 19, 26, 0.16), rgba(217, 19, 26, 0));
    transform: rotate(20deg);
}

.stat-box strong {
    position: relative;
    font-size: 1.5rem;
    color: #921218;
}

.toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    background: linear-gradient(140deg, #7f1015, #c9181f);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    z-index: 10;
    box-shadow: 0 14px 26px rgba(108, 12, 16, 0.35);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    42%,
    100% {
        transform: translateX(120%);
    }
}

@keyframes floatA {
    from {
        transform: translateY(0) translateX(0);
    }
    to {
        transform: translateY(22px) translateX(20px);
    }
}

@keyframes floatB {
    from {
        transform: translateY(0) translateX(0);
    }
    to {
        transform: translateY(-20px) translateX(-24px);
    }
}

@keyframes patternShift {
    from {
        background-position: 0 0, 80px 69px;
    }
    to {
        background-position: 160px 138px, 240px 207px;
    }
}

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

    .layout {
        padding: 14px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-card {
        margin-top: 4vh;
        padding: 22px;
    }

    table {
        min-width: 480px;
    }

    .data-table-modal-card {
        width: 100% !important;
        max-height: calc(100vh - 16px);
    }

    #data-table-modal {
        padding: 8px;
    }
}
