@font-face {
    font-family: timeburner;
    src: url(/static/Timeburner.ttf);
}

@font-face {
    font-family: timeburner-bold;
    src: url(/static/TimeburnerBold.ttf);
}

:root {
    --accent: #C28570; /* Accent color requested */
    --copper: #C28570;
    --copper-light: rgba(194, 133, 112, 0.52);
    --bg: #f7f7f8;
    --surface: #ffffff;
    --muted: #6b7280;

            --gap: 12px;
            --pad: 16px;
    --danger: #dc2626;
    --backdrop: rgba(0, 0, 0, 0.6); /* dark backdrop */
    --success: #3ba776;
    --error: #d9534f;
    --shadow: 0 6px 16px rgba(6, 10, 15, 0.08);
    --rounded: 9px;
    --glass: rgba(255, 255, 255, 0.6);
    --max-width: 1800px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Reset & base */
* {
    box-sizing: border-box
}

html, body, #app {
    height: 100%
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg), #ffffff);
    color: #111827;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 28px auto;
    padding: 20px;
}

.layout {
    display: grid;
    grid-template-columns:260px 1fr;
    gap: 20px;
    align-items: start;
}

/* Sidebar */
.sidebar {
    background: var(--surface);
    border-radius: var(--rounded);
    padding: 18px;
    box-shadow: var(--shadow);
    height: calc(100vh - 96px);
    position: sticky;
    top: 38px;
    overflow: auto;
}

.sidebar button {
    margin-top: 8px;
}


.sidebar p {
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    color: var(--muted);
}

.sidebar hr {
    color: var(--glass);
}

.card hr {
    color: var(--glass);
}

.brand {
    justify-content: center;
    text-align: center;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.brand h1 {
    color: var(--shadow);
}

/*.logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #b96f5a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700
}*/

nav ul {
    list-style: none;
    padding: 0;
    margin: 0
}

nav li {
    margin: 8px 0
}

nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 40px;
    color: var(--muted);
}

nav a.active {
    background: linear-gradient(90deg, rgba(194, 133, 112, 0.12), rgba(194, 133, 112, 0.06));
    border-left: 3px solid var(--accent);
    padding-left: 8px
}

/* Tabs styling */
nav.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 12px;
    justify-content: center;
    font-family: Timeburner;
}

.tab-content {
    display: none;
    padding-top: 4px
}

.tab-content.active {
    display: block
}

a.tab-link.active {
    color: var(--accent);
    font-weight: bold;
    background-image: none;
    border-radius: 0px;
    border-bottom: 3px solid var(--accent);
    border-left: none;
    font-family: Timeburner-bold;
}

/* Top bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    padding: 10px;
    border-radius: 999px;
    box-shadow: var(--shadow);
    min-width: 300px
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #b96f5a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700
}

/* Main content */
.main {
    min-height: 80vh;
}

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

.flex-cards {
    display: flex;
    grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
    justify-content: center;
}

.card {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--rounded);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s;
    box-shadow: var(--shadow);
}

.kpi {
    font-size: 20px;
    font-weight: 700
}

.kpi-small {
    color: var(--muted);
    font-size: 13px
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--rounded);
    /*overflow: hidden;*/
    box-shadow: var(--shadow);
    font-family: Monaco, serif;
    overflow: visible; /* Drop downs only. May be wrong.*/
}

.table th, .table td {
    padding: 11px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6
}

.table thead th {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.01));
    font-weight: 600
}

.table tr {
    position: relative;
}

.table tr:nth-child(odd) {

}

.table tr:hover {
    background-color: #e1e1e1;
}

.table .subth {
    font-weight: bold;
}


.table tr:hover #row-actions {
    visibility: visible;
}

.table tr img {
    max-width: 25px;
}

table.batch-data-table {
    font-family: Monaco, Serif;

    font-size: 12px;
    text-align: left;
}

table.batch-data-table td.right {
    padding-left: 20px;
}

.subrow {
    background-color: var(--surface);
    /* visibility: hidden; */
    display: none;
    margin-left: 10px;
}

.subrow td {
    font-size: 12px;
    padding: 5px;
}

#current_volume {
    max-width: 250px;
    max-height: 100px;
}

.subsubrow {
    background-color: #e8e8e8;
    /* visibility: hidden; */
    display: none;
}

.subsubrow td {
    display: table-caption;
    padding: 0px;
}

.grid-2 {
    width: 95%;
    font-family: Monaco, Serif;
    font-size: 15px;
    display: grid;
    grid-template-columns: 35% 65%; /* two equal columns */
    gap: 8px; /* spacing between cells */
    align-items: stretch; /* make cells same height in a row */
    margin-bottom: 16px;

    div {
        text-align: left;
        border-bottom: 2px dotted var(--accent);
        vertical-align: center;
    }

}

.grid-2 > div:nth-child(odd) {
    font-weight: bold;
}

.grid-2 h1 {
    text-align: center;
    width: 100%;

}

/* styling for demo */

/* optional: stack to one column on small screens */
@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.data-table {
    font-family: Monaco, serif;

    text-align: left;
    vertical-align: bottom;
    font-size: 13px;
    width: 90%;
    margin: auto;
    padding: 8px;
    margin-bottom: 40px;
    background-color: var(--surface);
}

.data-table th {
    border-bottom: 1px dotted #333;
}

.data-table td {
    vertical-align: bottom;
    border-bottom: 1px dotted #333;
}

.data-table .left {
    border-collapse: collapse;
    width: 20%;
    vertical-align: bottom;
}

.data-table .right {
    width: 70%;
    text-align: center;
}

/* Forms */
.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.form-label {
    font-weight: bold;
}

.form-error {
    color: var(--danger);
}

.input, .select, .textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6e6e9;
    background: #fff;
    min-width: 0
}

.btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 0;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(194, 133, 112, 0.12);
    transition: transform 0.2s;
}

.btn.ghost {
    background: transparent;
    border: 1px solid #e6e6e9;
    color: var(--muted)
}

.btn.wide {
    width: 100%;
}

.btn:hover {
    transform: translateY(-5px);
    cursor: pointer;
}

/* Small utilities */
.muted {
    color: var(--muted)
}

.pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(6, 10, 15, 0.04);
    font-size: 13px
}

/* Form */
fieldset {
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px
}

label {
    font-weight: 600;
    color: #111827
}

input, select, textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6e6e9;
    background: #fff;
    font-size: 14px;
    width: 100%
}

footer {
    margin-top: 28px;
    color: var(--muted);
    font-size: 13px;
    text-align: center
}

.header-card {
    background: white;
    color: var(--accent);
    padding: 20px;
    border-radius: var(--rounded);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-height: 100px
}

.header-card h1 {
    font-size: 32px;
    font-family: Timeburner-bold;
}

.header-card h2 {
    font-size: 18px;
    font-weight: 300;
    color: var(--muted);
}


/* Responsive */
@media (max-width: 900px) {
    .layout {
        grid-template-columns:1fr;
    }

    .sidebar {
        height: auto;
        position: relative;
        top: 0
    }
}

/* Own additions */
h1 {
    font-family: Timeburner;
}

.nav-icon {
    display: inline-block;
    max-width: 25px;
}

.logo {
    max-width: 155px;
    margin-bottom: -25px;
}

/*Hero */
/* Hero quick-actions */
.hero {
    background: linear-gradient(90deg, rgba(194, 133, 112, 0.15), rgba(194, 133, 112, 0.05));
    padding: 24px;
    border-radius: var(--rounded);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.hero-content h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700
}

.hero-content p {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: var(--muted)
}

.hero-actions {
    display: flex;
    gap: 12px
}


/* --- Modal Overlay --- */
.modal {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

/* --- Modal Window --- */
.modal-content {
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    animation: scaleIn 0.2s ease forwards;
    transform: scale(0.95);
}

.modal-content.wide {
    max-width: 900px;
}

/* --- Close Button (optional) --- */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
}

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


.hero-section a {
    color: var(--shadow);
    font-family: Timeburner-bold;
}

.report-list {
    text-align: center;
    width: 100%;
    display: flex; /* TODO think about this */
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
}

.report-hero {
    flex-basis: 40%;
    height: 140px;
    font-size: 12px;
    box-sizing: border-box;
    /*margin-top: 15px; !* TODO think about this *!*/
    flex-grow: 1;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--muted);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.report-hero-section {
    flex: 1;
    text-align: center;
}

.report-hero-section .warn {
    background-color: #dfafaf;
}

.report-hero-section.middle {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.report-hero svg {
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
}

.report-hero img {
    top: 0px !important;
    right: 0px !important;
    max-width: 80px;
    background: none;
    border-radius: 0% !important;
    background-color: rgba(0, 0, 0, 0.0) !important; /*TODO fix this*/
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.1) !important;
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
    padding: 0px !important;
    position: relative !important; /*// TODO: Restructure such that .card img has an own class*/
}

.report-hero.report-done {
    background-color: #baf6ba;

    border: none;
}

.report-hero-text {
    font-size: 14px;
}

.report-hero:hover {
    transform: translateY(-5px);
    cursor: pointer;
}

.kpi-img {
    float: right;
}

.glyph {
    position: absolute;
    top: -10px;
    right: -10px;
    max-width: 80px;
    background-color: var(--surface);
    border-radius: 20%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 5px;
}

/* Flash messages */
.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.flash-message {
    padding: 14px 18px;
    border-radius: var(--rounded);
    box-shadow: var(--shadow);
    font-weight: 500;
}

.flash-success {
    background: var(--success);
    color: white
}

.flash-error {
    background: var(--error);
    color: white
}

.flash-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-weight: bold;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--bg)
}


@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.hero-notice {
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--rounded);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    box-shadow: var(--shadow);

    img {
        max-width: 30px;
    }
}

.hero-notice .warn {
    color: var(--danger)
}

.hero-notice .info {
    color: var(--shadow)
}

.hero-actions {
    display: flex;
    gap: 10px
}

.dropdown {
    position: relative;
}

/* Dropdown */
.btn .drop {
    color: white;
    padding: 16px;
    font-size: 16px;
    border: none;
'' cursor: pointer;
    transition: none !important;
}

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

.btn.mini {
    padding: 4px 8px;
}

.drop:hover {
    transform: none;
    cursor: pointer;
}

/* Dropdown content */
.dropdown-content {
    /*background: linear-gradient(90deg, rgba(194, 133, 112, 0.15), rgba(194, 133, 112, 0.05));*/
    display: none;
    position: absolute;
    background-color: var(--surface);
    min-width: 200px;
    font-size: 12px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 999;
    right: 0;
    border-radius: var(--rounded);
}

/* Links inside dropdown content */
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid var(--copper-light);
    border-radius: var(--rounded);
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {
    background-color: #f1f1f1;

    border-radius: var(--rounded);
}

/* Show the dropdown content on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Change background color of dropdown button on hover */
.dropdown:hover .dropbtn {
    background-color: #3e8e41;
}

.icon {
    max-width: 25px;
    border: none;
    box-shadow: none;
}

.dropdown-content a {
    display: flex;

    align-items: center;
    gap: 10px;
}


/* DARK MODE */
/* Dark theme follows OS preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220; /* page background */
        --surface: #0f1724; /* cards, panels */
        --muted: #9aa6b2; /* secondary text */
        --shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
    }

    body {
        background: linear-gradient(180deg, var(--bg), #071125);
        color: #e6eef6
    }

    a {
        color: var(--accent)
    }

    .sidebar {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent)
    }

    .card, .header-card, .hero-notice {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
        border-color: rgba(255, 255, 255, 0.04)
    }

    .table th, .table td {
        border-bottom-color: rgba(255, 255, 255, 0.03)
    }

    .pill {
        background: rgba(255, 255, 255, 0.03)
    }

    .avatar {
        background: linear-gradient(135deg, var(--accent), #b96f5a)
    }

    .logo {
        background: linear-gradient(135deg, var(--accent), #b96f5a)
    }

    /* In dark mode make ghost buttons lighter outlines */
    .btn.ghost {
        border-color: rgba(255, 255, 255, 0.06);
        color: var(--muted)
    }

    .dropdown-content a {
        color: white;
    }

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

/* Manual override: add .dark-mode to <html> or <body> to force dark theme */
.dark-mode {
    --bg: #0b1220;
    --surface: #0f1724;
    --muted: #9aa6b2;
    --shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
}

.batch_card {
    /*aspect-ratio: 3 / 4; !* enforces the 3:4 ratio *!*/
    background: var(--surface);
    border-radius: var(--rounded);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(16, 24, 40, 0.06);
}


/* Top row: left-aligned title */
.batch_card__top {
    padding: calc(var(--pad) / 1.5) var(--pad);
    display: flex;
    align-items: center;
    justify-content: flex-start; /* left-aligned */
    gap: 8px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), rgba(99, 102, 241, 0.03));
}

.batch_card__top .title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
}

/* Middle section: h1 and h2 stacked */
.batch_card__body {
    flex: 1; /* expands to fill available space */
    padding: var(--pad);
    display: flex;
    /*justify-content: center; !* centers vertically *!*/
    gap: 6px;

    div {
        flex-direction: column;
    }
}

.batch_card__body h1 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.batch_card__body h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--muted);
    font-weight: 600;
}

/* Bottom row: up to four data elements */
.batch_card__bottom {
    padding: calc(var(--pad) / 1.2);
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* max 4 columns */
    gap: var(--gap);
    align-items: center;
    border-top: 1px solid rgba(15, 23, 42, 0.04);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.98));
}

.data-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 6px;
}

.data-item .value {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

.data-item .label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}