@font-face {
    font-family: "NRT";
    src: url("../assets/fonts/nrt.ttf") format("truetype");
    font-display: swap;
}

:root {
    --bg: #eef4ff;
    --bg-strong: #dceaff;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #f9fbff;
    --line: rgba(17, 43, 89, 0.13);
    --text: #14213d;
    --muted: #55637d;
    --brand: #1267e8;
    --brand-strong: #074cae;
    --accent: #ff7a18;
    --violet: #6a42d8;
    --pink: #e53f8b;
    --success: #087a53;
    --danger: #c6364e;
    --shadow: 0 24px 60px rgba(30, 70, 132, 0.14);
    --radius: 24px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 4% 10%, rgba(18, 103, 232, 0.22), transparent 27%),
        radial-gradient(circle at 96% 18%, rgba(229, 63, 139, 0.16), transparent 24%),
        radial-gradient(circle at 74% 90%, rgba(255, 122, 24, 0.16), transparent 29%),
        linear-gradient(145deg, var(--bg), #f9fcff 56%, #eee8ff 100%);
    color: var(--text);
    font-family: "NRT", sans-serif;
    letter-spacing: 0.01em;
    animation: atmosphere 16s ease-in-out infinite alternate;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    animation: reveal-shell 0.55s ease both;
}

.topbar,
.main-nav,
.card,
.auth-card,
.flash {
    backdrop-filter: blur(12px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(236, 244, 255, 0.84));
    box-shadow: var(--shadow);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand), var(--violet) 58%, var(--pink));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.12em;
    box-shadow: 0 12px 26px rgba(18, 103, 232, 0.28);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-title,
.page-hero h2,
.card h3 {
    margin: 0;
    font-weight: 700;
}

.brand-subtitle,
.page-hero p,
.card p,
.auth-subtitle,
.table-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-pills,
.language-switcher {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill,
.meta-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(18, 103, 232, 0.09);
    color: var(--brand-strong);
    font-size: 0.92rem;
    font-weight: 600;
}

.branch-switcher {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.branch-switcher select,
.language-select,
.form-grid select,
.filters-grid select,
.filters-grid input,
.form-grid input,
.form-grid textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.logout-link,
.button,
button,
input[type="submit"] {
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand), var(--violet));
    color: #fff;
    padding: 12px 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.logout-link:hover,
.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(18, 103, 232, 0.24);
    filter: saturate(1.1);
}

.button.secondary,
.nav-link,
.language-switcher a {
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    border: 1px solid var(--line);
}

.main-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0 24px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
}

.nav-link {
    padding: 10px 14px;
    border-radius: 14px;
    transition: 0.2s ease;
}

.nav-link.is-active,
.nav-link:hover,
.language-switcher a:hover,
.button.secondary:hover {
    background: linear-gradient(135deg, rgba(18, 103, 232, 0.14), rgba(106, 66, 216, 0.12));
    color: var(--brand-strong);
}

.main-content {
    display: grid;
    gap: 20px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.page-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.flash {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
}

.flash-success {
    border-color: rgba(22, 101, 52, 0.24);
    color: var(--success);
}

.flash-error {
    border-color: rgba(185, 28, 28, 0.24);
    color: var(--danger);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 255, 0.8));
    box-shadow: var(--shadow);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 68px rgba(30, 70, 132, 0.18);
}

.main-content > * {
    animation: rise-in 0.5s ease both;
}

.main-content > *:nth-child(2) { animation-delay: 0.06s; }
.main-content > *:nth-child(3) { animation-delay: 0.12s; }
.main-content > *:nth-child(4) { animation-delay: 0.18s; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

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

.stat-tile {
    padding: 18px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid rgba(18, 103, 232, 0.12);
    position: relative;
    overflow: hidden;
}

.stat-tile::after {
    content: "";
    position: absolute;
    inset: auto -18px -28px auto;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(18, 103, 232, 0.14), rgba(229, 63, 139, 0.12));
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-value {
    margin-top: 10px;
    font-size: 1.3rem;
    font-weight: 700;
}

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

.action-card {
    display: block;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(18, 103, 232, 0.11), rgba(106, 66, 216, 0.08) 52%, rgba(255, 122, 24, 0.12));
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.action-card:hover {
    transform: translateY(-5px) rotate(-0.3deg);
    border-color: rgba(18, 103, 232, 0.35);
    box-shadow: 0 18px 34px rgba(38, 76, 157, 0.16);
}

.action-card-featured {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #0766e7, #6a42d8 58%, #d33c91);
    box-shadow: 0 18px 35px rgba(55, 67, 182, 0.24);
}

.action-card-featured span {
    color: rgba(255, 255, 255, 0.8);
}

.action-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 8px;
}

.action-card span {
    color: var(--muted);
    font-size: 0.94rem;
}

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

.form-grid .full,
.filters-grid .full {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: 8px;
}

.field label,
.filters-grid label {
    font-size: 0.92rem;
    font-weight: 600;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.inline-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-chip,
.checkbox-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.82);
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(73, 58, 39, 0.08);
    text-align: start;
    vertical-align: top;
}

th {
    background: rgba(18, 103, 232, 0.08);
    font-size: 0.92rem;
}

.tag {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(194, 65, 12, 0.12);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

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

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 242, 0.88));
}

.auth-story {
    padding: 42px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 40%),
        radial-gradient(circle at bottom right, rgba(255, 122, 24, 0.52), transparent 38%),
        linear-gradient(145deg, #0a55cb, #6a42d8 55%, #be3f96);
    color: #fff;
}

.auth-story h1,
.auth-panel h2 {
    margin: 0;
}

.auth-brand,
.receipt-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand .brand-mark {
    flex: 0 0 54px;
}

.auth-story ul {
    margin: 24px 0 0;
    padding-inline-start: 20px;
    line-height: 1.8;
}

.auth-panel {
    padding: 42px;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    font: inherit;
}

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

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 6px 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.receipt-sheet {
    width: min(900px, 100%);
    margin: 0 auto;
    padding: 32px;
    border-radius: 26px;
    background: #fff;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.receipt-brand img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
}

.company-layout {
    align-items: stretch;
}

.cashier-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: 20px;
    align-items: start;
}

.cashier-card {
    padding: 28px;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.97), rgba(235, 244, 255, 0.88));
}

.cashier-form {
    display: grid;
    gap: 20px;
}

.cashier-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cashier-type-toggle label {
    cursor: pointer;
}

.cashier-type-toggle input {
    position: absolute;
    opacity: 0;
}

.cashier-type-toggle span {
    display: grid;
    place-items: center;
    min-height: 66px;
    border: 1px solid rgba(18, 103, 232, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 700;
    transition: 0.2s ease;
}

.cashier-type-toggle input:checked + span {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand), var(--violet));
    box-shadow: 0 12px 22px rgba(27, 82, 197, 0.24);
}

.cashier-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr);
    gap: 16px;
}

.cashier-form select,
.cashier-form input {
    min-height: 58px;
    font-size: 1.1rem;
}

.cashier-submit {
    min-height: 64px;
    font-size: 1.12rem;
    background: linear-gradient(135deg, #087a53, #10a76c);
}

.cashier-aside {
    display: grid;
    gap: 18px;
}

.cashier-last-document {
    background: linear-gradient(145deg, #0a56c9, #6840d5);
    color: #fff;
}

.cashier-last-document .eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.report-filter-action {
    align-self: end;
}

.report-link-card {
    display: grid;
    align-content: center;
    justify-items: start;
    background: linear-gradient(145deg, rgba(255, 122, 24, 0.13), rgba(229, 63, 139, 0.1));
}

.company-preview {
    color: #fff;
    background:
        radial-gradient(circle at 90% 16%, rgba(255, 255, 255, 0.24), transparent 18%),
        linear-gradient(145deg, #0a55cb, #6a42d8 58%, #bd3e95);
    border: 0;
}

.company-preview p,
.company-preview .eyebrow,
.company-preview-meta {
    color: rgba(255, 255, 255, 0.78);
}

.company-logo-preview {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 35px rgba(3, 19, 85, 0.25);
    font-size: 2rem;
    font-weight: 700;
}

.company-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-preview-meta {
    display: grid;
    gap: 8px;
    margin-top: 26px;
}

.eyebrow,
.field-hint {
    color: var(--muted);
    font-size: 0.9rem;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px dashed rgba(18, 103, 232, 0.35);
    border-radius: 14px;
    background: rgba(18, 103, 232, 0.04);
    font: inherit;
}

@keyframes reveal-shell {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes atmosphere {
    from { background-position: 0 0, 100% 0, 50% 100%, 0 0; }
    to { background-position: 4% 2%, 94% 4%, 58% 94%, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px dashed rgba(73, 58, 39, 0.25);
}

.receipt-block {
    margin-top: 18px;
}

.receipt-block h3 {
    margin: 0 0 10px;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(73, 58, 39, 0.08);
}

.print-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

@media (max-width: 980px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .topbar,
    .page-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-tools {
        justify-content: flex-start;
    }

    .cashier-layout,
    .cashier-row {
        grid-template-columns: 1fr;
    }
}
