:root {
    --ink: #14110d;
    --navy: #0c121c;
    --navy-2: #152235;
    --gold: #b8892d;
    --gold-2: #e8c56b;
    --gold-deep: #8f6a1f;
    --paper: #ece6db;
    --card: #fffaf2;
    --line: #ddd2c0;
    --muted: #7a7166;
    --anadolu: #1e4fd8;
    --avrupa: #c2410c;
    --success: #0f766e;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(20, 17, 13, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: Manrope, "Segoe UI", sans-serif;
    background:
        radial-gradient(900px 420px at 88% -8%, rgba(184, 137, 45, 0.16), transparent 46%),
        radial-gradient(700px 360px at 0% 100%, rgba(21, 34, 53, 0.06), transparent 50%),
        linear-gradient(180deg, #f4efe6 0%, var(--paper) 100%);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
}

h1, h2, h3, .brand h1, .login-brand h1, .stat-value, .donut-center strong {
    font-family: Fraunces, Georgia, serif;
    font-optical-sizing: auto;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 272px;
    background:
        linear-gradient(180deg, rgba(232, 197, 107, 0.08), transparent 16%),
        linear-gradient(180deg, #090e16 0%, #121c2c 100%);
    color: #fff;
    padding: 1.5rem 1.05rem 1.2rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(232, 197, 107, 0.12);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.7rem;
    padding: 0.2rem 0.35rem 1.25rem;
    border-bottom: 1px solid rgba(232, 197, 107, 0.16);
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-family: Fraunces, serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(145deg, #f0d48a, var(--gold));
    color: #1a1408;
    box-shadow: 0 10px 24px rgba(184, 137, 45, 0.28);
}

.brand h1 {
    margin: 0;
    font-size: 1.12rem;
}

.brand p {
    margin: 0.12rem 0 0;
    color: #b7c0cc;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    flex: 1;
}

.nav-section {
    margin: 1.05rem 0.45rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8b9aaf;
}

.nav a {
    color: #d5deea;
    padding: 0.68rem 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 600;
}

.nav-ico {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    opacity: 0.85;
}

.nav-ico svg {
    width: 18px;
    height: 18px;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.nav a.active {
    background: linear-gradient(90deg, rgba(184, 137, 45, 0.22), rgba(184, 137, 45, 0.08));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--gold-2);
    text-decoration: none;
}

.user-info {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(232, 197, 107, 0.18);
    color: var(--gold-2);
    font-weight: 800;
}

.user-info small {
    display: block;
    color: #9aa8b8;
}

.content {
    flex: 1;
    padding: 1.8rem 2rem 2.4rem;
    max-width: 100%;
    overflow-x: auto;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.page-header h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.03em;
}

.page-kicker {
    margin: 0 0 0.25rem;
    color: var(--gold-deep);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.card {
    background: var(--card);
    border-radius: 22px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 1.3rem 1.35rem;
    margin-bottom: 1.2rem;
}

.card h3 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
}

.alert {
    padding: 0.9rem 1.05rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.62rem 1.12rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(180deg, #e3bc5e, var(--gold));
    color: #1a1408;
    box-shadow: 0 8px 18px rgba(184, 137, 45, 0.28);
}

.btn-primary:hover {
    filter: brightness(1.05);
    text-decoration: none;
    color: #1a1408;
}

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid #e2d6c4;
}

.btn-secondary:hover {
    background: #f7f0e4;
    text-decoration: none;
    color: var(--ink);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #911c16;
    text-decoration: none;
    color: #fff;
}

.btn-sm {
    padding: 0.34rem 0.7rem;
    font-size: 0.78rem;
}

.btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

.filter-hint {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.9rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #4a433b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.68rem 0.8rem;
    border: 1px solid #e0d4c2;
    border-radius: 12px;
    font-size: 0.95rem;
    width: 100%;
    background: #fff;
    font-family: inherit;
    color: var(--ink);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(184, 137, 45, 0.16);
}

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

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead {
    background: #f6efe2;
}

th,
td {
    padding: 0.78rem 0.8rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    font-weight: 800;
    white-space: nowrap;
    color: #4a433b;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #fbf6ec;
}

th.col-date,
td.col-date {
    white-space: nowrap;
    min-width: 6.75rem;
}

.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.summary span,
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    background: #f4eee3;
    font-weight: 800;
    font-size: 0.8rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: var(--navy);
}

.login-brand {
    padding: 4.5rem;
    color: #fff;
    background:
        radial-gradient(520px 280px at 18% 18%, rgba(232, 197, 107, 0.22), transparent 58%),
        linear-gradient(160deg, #090e16, #18263b);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand .brand-mark {
    margin-bottom: 1.5rem;
}

.login-brand h1 {
    margin: 0 0 0.7rem;
    font-size: 3rem;
    letter-spacing: -0.03em;
}

.login-brand p {
    margin: 0;
    max-width: 28rem;
    color: #c9d3e0;
    font-size: 1.08rem;
}

.login-side {
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 2.1rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-card h2 {
    margin: 0 0 0.3rem;
    font-size: 1.8rem;
}

.login-card > p {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.stat-card {
    background: var(--card);
    border-radius: 22px;
    padding: 1.2rem 1.2rem 1.1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.75);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-2), var(--gold));
}

.stat-card.teal::after { background: linear-gradient(90deg, #5eead4, var(--success)); }
.stat-card.blue::after { background: linear-gradient(90deg, #93c5fd, var(--anadolu)); }
.stat-card.orange::after { background: linear-gradient(90deg, #fdba74, var(--avrupa)); }

.stat-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-value {
    margin: 0.45rem 0 0;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.05fr 0.9fr;
    gap: 1.1rem;
}

.chart-card {
    min-height: 280px;
}

.pie-wrap {
    display: flex;
    align-items: center;
    gap: 1.3rem;
}

.donut-chart {
    position: relative;
    width: 176px;
    height: 176px;
    flex-shrink: 0;
}

.donut-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-track,
.donut-slice {
    fill: none;
    stroke-width: 11;
}

.donut-track {
    stroke: #efe4d2;
}

.donut-slice {
    stroke-linecap: butt;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.donut-center strong {
    font-size: 1.45rem;
    line-height: 1;
}

.donut-center span {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.legend-item strong {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    font-size: 0.84rem;
}

.bar-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.bar-row {
    display: grid;
    grid-template-columns: 7.6rem 1fr 2.5rem;
    gap: 0.65rem;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
}

.bar-track {
    height: 9px;
    background: #efe7d8;
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #c8922a);
    border-radius: 999px;
}

.bar-row strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.quick-link {
    display: block;
    padding: 1.15rem 1.15rem 1.05rem;
    border-radius: 20px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.8);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
}

.quick-link:hover {
    text-decoration: none;
    border-color: var(--gold);
    transform: translateY(-1px);
}

.quick-link strong {
    font-family: Fraunces, Georgia, serif;
    font-size: 1.12rem;
}

.quick-link span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    margin-top: 0.3rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.2rem;
    color: var(--muted);
}

.empty-state h3 {
    margin: 0 0 0.45rem;
    color: var(--ink);
    font-size: 1.45rem;
}

.money-preview {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.money-preview strong {
    color: var(--success);
}

.badge {
    display: inline-flex;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.badge-anadolu {
    background: #dbeafe;
    color: #1e40af;
}

.badge-avrupa {
    background: #ffedd5;
    color: #9a3412;
}

.badge-cargo {
    background: #eef2ff;
    color: #3730a3;
}

.badge-shipment {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 1100px) {
    .stats-grid,
    .dashboard-grid,
    .quick-links {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .layout,
    .login-page {
        display: flex;
        flex-direction: column;
    }

    .sidebar,
    .login-brand {
        width: 100%;
        padding: 1.2rem;
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-section {
        width: 100%;
        margin-top: 0.5rem;
    }

    .content {
        padding: 1rem;
    }

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

    .stats-grid,
    .dashboard-grid,
    .quick-links,
    .bar-row {
        grid-template-columns: 1fr;
    }

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

@media print {
    body {
        background: #fff;
    }

    body.print-landscape {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .no-print,
    .alert {
        display: none !important;
    }

    .layout {
        display: block;
    }

    .content {
        padding: 0;
        max-width: none;
    }

    .card {
        box-shadow: none;
        border: none;
        padding: 0;
        background: #fff;
    }

    .print-page-landscape {
        max-width: none;
        width: 100%;
        padding: 0;
    }

    .print-table {
        font-size: 10px;
        table-layout: fixed;
        width: 100%;
    }

    .print-table th,
    .print-table td {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        padding: 4px 6px;
    }

    .print-table .col-wide {
        width: 15%;
    }

    .print-table .col-date {
        width: 9%;
        white-space: nowrap;
    }

    .print-table .col-narrow {
        width: 7%;
    }

    @page {
        size: A4 landscape;
        margin: 10mm;
    }
}

.print-page {
    max-width: 210mm;
    margin: 0 auto;
    background: #fff;
    padding: 1rem;
}

.print-page-landscape {
    max-width: 297mm;
}

.print-table {
    table-layout: fixed;
    width: 100%;
}

.print-table .col-wide {
    width: 15%;
}

.print-table .col-date {
    width: 9%;
    white-space: nowrap;
}

.print-table .col-narrow {
    width: 7%;
}

.print-table th,
.print-table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.print-header {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 0.85rem;
}

.print-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}

.print-header p {
    margin: 0;
    color: #4b5563;
    font-size: 0.875rem;
}

.print-summary {
    margin-top: 1rem;
    font-weight: 600;
}

.print-totals {
    margin-top: 1.15rem;
    margin-left: auto;
    width: min(360px, 100%);
    border: 1px solid #e2d6c4;
    border-radius: 12px;
    overflow: hidden;
}

.print-totals-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #eee4d6;
    font-size: 0.9rem;
}

.print-totals-row:last-child {
    border-bottom: none;
}

.print-totals-row.grand {
    background: #f6efe2;
    font-weight: 800;
}

.print-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.print-brand .mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--gold);
    color: #1a1408;
    font-family: Fraunces, serif;
    font-weight: 700;
}

.log-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.log-badge-created {
    background: #ecfdf5;
    color: #065f46;
}

.log-badge-updated {
    background: #eff6ff;
    color: #1d4ed8;
}

.log-badge-deleted {
    background: #fef2f2;
    color: #991b1b;
}

.log-details {
    margin: 0.5rem 0 0;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 420px;
}
