:root {
    --bg-page: #f4f7fb;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-solid: #ffffff;

    --text-main: #18212e;
    --text-soft: #667387;
    --text-muted: #8a96a8;

    --border-soft: #dbe4ef;
    --border-strong: #c9d5e4;

    --shadow-soft: 0 10px 30px rgba(40, 66, 104, 0.08);
    --shadow-card: 0 18px 50px rgba(43, 74, 117, 0.08), 0 4px 16px rgba(43, 74, 117, 0.05);
    --shadow-button: 0 12px 22px rgba(37, 99, 235, 0.28);

    --radius-card: 24px;
    --radius-input: 16px;
    --radius-button: 16px;
    --radius-pill: 999px;

    --blue-1: #6fb4ff;
    --blue-2: #3b82f6;
    --blue-3: #2563eb;
    --blue-4: #1e40af;

    --success-soft: #eaf8ef;
    --warning-soft: #fff8e7;
    --danger-soft: #fdeeee;

    --table-header: #eef4fb;
}

/* ==========================================================
   BASE
   ========================================================== */

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(127, 173, 255, 0.10), transparent 30%),
        radial-gradient(circle at bottom right, rgba(165, 205, 255, 0.12), transparent 28%),
        linear-gradient(180deg, #f7f9fc 0%, var(--bg-page) 100%);
    color: var(--text-main);
    min-height: 100vh;
}

body.login-page {
    height: 100vh;
    overflow: hidden;
}

body.login-page .container {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text-main);
}

h1 {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 700;
}

h2 {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin-bottom: 8px;
}

h3 {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-title,
.card h3 {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.section-subtitle {
    margin: -4px 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-soft);
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px 32px;
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    padding: 22px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card>h2:first-child,
.card>h3:first-child,
.card>.section-title:first-child,
.card>.page-header:first-child {
    margin-top: 0;
}

.card>h3 {
    margin-top: 0;
    margin-bottom: 14px;
}

.card>p {
    margin-top: 0;
    margin-bottom: 18px;
}

.card>*:last-child {
    margin-bottom: 0;
}

/* ==========================================================
   APP HEADER / HAMBURGER NAV
   ========================================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1200;
}

.app-header-top {
    margin-bottom: 0;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-toggle,
.menu-close {
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-soft);
    cursor: pointer;
}

.menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: 0 8px 20px rgba(43, 74, 117, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.menu-toggle:hover {
    transform: translateY(-1px);
    border-color: #a8c2ef;
    background: #ffffff;
    box-shadow: 0 12px 22px rgba(43, 74, 117, 0.10);
}

.menu-toggle-line {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #28406b;
    display: block;
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    z-index: 1290;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(380px, 92vw);
    height: 100vh;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid var(--border-soft);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    z-index: 1300;
    display: flex;
    flex-direction: column;
}

.nav-drawer.is-open {
    transform: translateX(0);
}

.nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.nav-drawer-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.menu-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    color: #334155;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.menu-close:hover {
    background: #ffffff;
    border-color: #a8c2ef;
    transform: translateY(-1px);
}

.nav-drawer-content {
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.drawer-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-group-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a8aa0;
    padding-left: 4px;
}

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.88);
    color: #243048;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.drawer-link:hover {
    background: #ffffff;
    border-color: #a8c2ef;
    transform: translateY(-1px);
}

.drawer-link.active {
    background: linear-gradient(135deg, #eef5ff 0%, #dceaff 100%);
    color: #1f4ea8;
    border-color: #a8c2ef;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.10);
}

/* ==========================================================
   APP SHELL / SIDEBAR
   ========================================================== */

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

.app-sidebar {
    width: 232px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid var(--border-soft);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 16px 14px;
    box-sizing: border-box;
    transition: width 0.22s ease, padding 0.22s ease;
    z-index: 1200;
}

.app-sidebar.is-collapsed {
    width: 84px;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.sidebar-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(43, 74, 117, 0.08);
    transition: all 0.18s ease;
}

.sidebar-toggle:hover {
    transform: translateY(-1px);
    border-color: #a8c2ef;
    background: #ffffff;
}

.sidebar-toggle-line {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #28406b;
    display: block;
}

.sidebar-brand {
    min-width: 0;
    overflow: hidden;
}

.sidebar-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.app-sidebar.is-collapsed .sidebar-brand-text {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    color: #243048;
    text-decoration: none;
    transition: all 0.18s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.76);
    border-color: var(--border-soft);
    transform: translateY(-1px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, #eef5ff 0%, #dceaff 100%);
    color: #1f4ea8;
    border-color: #a8c2ef;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.10);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 600;
}

.app-sidebar.is-collapsed .sidebar-label {
    display: none;
}

.app-sidebar.is-collapsed .sidebar-link {
    justify-content: center;
    padding: 0;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1100;
}

.app-topbar-inner {
    margin-bottom: 0;
}

.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-menu-toggle,
.mobile-menu-close {
    display: none;
    appearance: none;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
}

.mobile-menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: 0 8px 20px rgba(43, 74, 117, 0.08);
}

.mobile-menu-line {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #28406b;
    display: block;
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    z-index: 1290;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(360px, 92vw);
    height: 100vh;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid var(--border-soft);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    z-index: 1300;
    display: none;
    flex-direction: column;
}

.mobile-nav-drawer.is-open {
    transform: translateX(0);
}

.nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.mobile-nav-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    color: #334155;
}

.mobile-nav-content {
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.88);
    color: #243048;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.mobile-drawer-link.active {
    background: linear-gradient(135deg, #eef5ff 0%, #dceaff 100%);
    color: #1f4ea8;
    border-color: #a8c2ef;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.10);
}

body.nav-open {
    overflow: hidden;
}

/* ==========================================================
   HEADER
   ========================================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 1100;
    padding: 16px 24px 14px;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 2px 12px rgba(43, 74, 117, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

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

.user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.65);
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-size: 14px;
    color: var(--text-soft);
    white-space: nowrap;
}

.user-bar a {
    color: inherit;
    text-decoration: none;
}

.user-bar a:hover {
    text-decoration: none;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
}

.user-separator {
    color: #a6b2c1;
}

.logout-btn {
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    border: 1px solid var(--border-soft);
    transition: all 0.15s ease;
}

.logout-btn:hover {
    background: #ffffff;
    border-color: #a8c2ef;
    transform: translateY(-1px);
}

/* ==========================================================
   MAIN NAV
   ========================================================== */

.nav-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
    margin-top: 14px;
    align-items: flex-start;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.nav-group-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a8aa0;
    padding-left: 4px;
    margin-bottom: 2px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    padding-top: 2px;
}

.nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: #243048;
    background: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.15s ease;
}

.nav a:hover {
    background: #ffffff;
    border-color: #a8c2ef;
    transform: translateY(-1px);
}

.nav a.active {
    background: linear-gradient(135deg, #eef5ff 0%, #dceaff 100%);
    color: #1f4ea8;
    border-color: #a8c2ef;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.10);
}

.nav-group .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    padding-top: 0;
}

.nav-group .nav a {
    width: auto;
    min-width: 0;
    padding: 8px 14px;
    font-size: 13px;
}

/* ==========================================================
   TAB NAV
   ========================================================== */

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 20px;
}

.tab-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.76);
    color: #35517c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.18s ease;
}

.tab-nav a:hover {
    background: #ffffff;
    border-color: #a8c2ef;
    transform: translateY(-1px);
}

.tab-nav a.active {
    background: linear-gradient(135deg, #eef5ff 0%, #dceaff 100%);
    color: #1f4ea8;
    border-color: #a8c2ef;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.10);
}

/* ==========================================================
   FORMS / BUTTONS
   ========================================================== */

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #526072;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-input);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text-main);
    font-size: 14px;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #9bb9ea;
    box-shadow: 0 0 0 4px rgba(112, 162, 255, 0.14);
    transform: translateY(-1px);
}

button,
.button,
.print-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-button);
    background: linear-gradient(135deg, var(--blue-1) 0%, var(--blue-2) 60%, var(--blue-3) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-button), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

button:hover,
.button:hover,
.print-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #5aa8ff 0%, var(--blue-3) 70%, var(--blue-4) 100%);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    filter: brightness(1.03);
}

button:active,
.button:active,
.print-btn:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================
   MESSAGES / UTIL
   ========================================================== */

.message {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #eef6ff;
    border: 1px solid #cfe0f4;
    border-radius: 14px;
    color: #244267;
}

.sale-row {
    background: #fdeeee !important;
}

.count-info {
    margin: 6px 0 18px 0;
    color: var(--text-soft);
    font-size: 14px;
}

/* ==========================================================
   SEARCH
   ========================================================== */

.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
}

.search-field {
    flex: 1 1 320px;
    width: 100%;
    max-width: 420px;
}

.search-field label {
    display: none !important;
}

.search-field input {
    margin-top: 0;
}

.search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-button);
    text-decoration: none;
    color: #35517c;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.search-actions a:hover {
    background: #ffffff;
    border-color: #a8c2ef;
    transform: translateY(-1px);
}

.save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid var(--border-soft);
    padding: 12px 24px;
    display: none;
    justify-content: flex-end;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(43, 74, 117, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ==========================================================
   KPI CARDS
   ========================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 16px;
    margin-top: 8px;
    margin-bottom: 24px;
    align-items: stretch;
}

.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
    min-width: 0;
    height: 100%;
}

.stat-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    padding: 16px 18px 14px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 88px;
    height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-sizing: border-box;
}

.stat-link:hover .stat-card {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.stat-link.active .stat-card {
    border-color: #9bb9ea;
    box-shadow: 0 0 0 3px rgba(112, 162, 255, 0.12), var(--shadow-soft);
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 8px;
    line-height: 1.25;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

/* ==========================================================
   TABLES
   ========================================================== */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

th,
td {
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #eef3f8;
}

th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--table-header);
    font-weight: 700;
    color: #445268;
    white-space: nowrap;
    font-size: 13px;
}

td {
    background: transparent;
    font-size: 14px;
}

tbody tr:hover td {
    background: rgba(111, 180, 255, 0.06);
}

tbody tr:last-child td {
    border-bottom: none;
}

th a {
    color: #2b4267;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

th a:hover {
    text-decoration: none;
    opacity: 0.85;
}

/* AMAZON ZEILENFARBEN */

table tr.row-ok td {
    background-color: #eaf8ef !important;
}

table tr.row-warning td {
    background-color: #fff8e7 !important;
}

table tr.row-critical td {
    background-color: #fdeeee !important;
}

/* ==========================================================
   TOGGLES
   ========================================================== */

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cfd8e4;
    transition: 0.2s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.switch input:checked+.slider {
    background: linear-gradient(135deg, #6fb4ff 0%, #2563eb 100%);
}

.switch input:checked+.slider:before {
    transform: translateX(22px);
}

/* ==========================================================
   PAGE HEADERS
   ========================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header-text {
    flex: 1;
    min-width: 0;
}

.page-header-text h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-main);
    font-weight: 700;
}

.page-header-text p,
.page-info {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
    font-size: 14px;
    max-width: 900px;
}

.page-header-action {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.page-header+.tab-nav,
.page-header+.nav,
.page-header+form,
.page-header+.stats-grid,
.page-header+.count-info,
.page-header+.grid,
.page-header+p {
    margin-top: 0;
}

.tab-nav+.stats-grid,
.tab-nav+form,
.tab-nav+.search-bar,
.tab-nav+.count-info,
.tab-nav+table,
.tab-nav+.card {
    margin-top: 0;
}

.stats-grid+.search-bar {
    margin-top: 0;
}

.search-bar+.count-info {
    margin-top: -4px;
}

/* ==========================================================
   LOGIN APPLE / CLEAN
   ========================================================== */

.login-wrapper-apple {
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 20px 20px;
    box-sizing: border-box;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 10%, rgba(127, 173, 255, 0.14), transparent 28%),
        radial-gradient(circle at 85% 85%, rgba(165, 205, 255, 0.18), transparent 30%),
        linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}

.login-card-apple {
    width: 100%;
    max-width: 440px;
    padding: 40px 34px 32px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(210, 220, 234, 0.85);
    border-radius: 30px;
    box-shadow:
        0 18px 50px rgba(43, 74, 117, 0.08),
        0 4px 16px rgba(43, 74, 117, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card-apple::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.38) 0%,
            rgba(255, 255, 255, 0.08) 45%,
            rgba(255, 255, 255, 0.00) 100%);
    pointer-events: none;
}

.login-logo-apple {
    position: relative;
    z-index: 1;
    margin-bottom: 18px;
    display: flex;
    justify-content: center;
}

.login-logo-apple img {
    max-width: 190px;
    height: auto;
    filter: drop-shadow(0 3px 10px rgba(46, 78, 124, 0.06));
}

.login-intro-apple {
    position: relative;
    z-index: 1;
    margin-bottom: 26px;
}

.login-intro-apple h2 {
    margin: 0 0 8px;
    font-size: 29px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #18212e;
    font-weight: 700;
}

.login-intro-apple p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #6c7788;
}

.login-form {
    position: relative;
    z-index: 1;
}

.login-field-apple {
    position: relative;
    z-index: 1;
    text-align: left;
    margin-bottom: 18px;
}

.login-field-apple label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #526072;
    letter-spacing: 0.01em;
}

.login-field-apple input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #d8e0eb;
    background: rgba(255, 255, 255, 0.92);
    color: #18212e;
    font-size: 15px;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.65),
        0 1px 2px rgba(27, 39, 54, 0.03);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease;
}

.login-field-apple input::placeholder {
    color: #98a3b3;
}

.login-field-apple input:focus {
    outline: none;
    border-color: #98b7e7;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(112, 162, 255, 0.14),
        0 4px 10px rgba(82, 119, 186, 0.05);
    transform: translateY(-1px);
}

.login-btn-apple {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: 10px;
    padding: 15px 18px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #6fb4ff 0%, #3b82f6 60%, #2563eb 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow:
        0 12px 22px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.login-btn-apple:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #5aa8ff 0%, #2563eb 70%, #1e40af 100%);
    box-shadow:
        0 16px 28px rgba(37, 99, 235, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    filter: brightness(1.03);
}

.login-btn-apple:active {
    transform: translateY(0);
    box-shadow:
        0 6px 12px rgba(37, 99, 235, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ==========================================================
   FOOTER / SIGNATURE
   ========================================================== */

.site-footer {
    margin-top: 28px;
    padding: 18px 0 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

.site-footer-love {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.site-footer-heart {
    color: #ef476f;
    font-size: 12px;
    line-height: 1;
}

.login-signature {
    margin-top: 22px;
    text-align: center;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.login-signature .site-footer-heart {
    font-size: 11px;
}

/* ==========================================================
   PRINT
   ========================================================== */

.no-print {
    display: inline-block;
}

.print-only {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .header,
    .nav-wrapper,
    .nav,
    .tab-nav,
    .user-bar,
    .search-bar,
    .search-actions,
    .save-bar,
    .print-actions,
    button,
    .logout-btn,
    .site-footer {
        display: none !important;
    }

    .container {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 11px !important;
        box-shadow: none !important;
    }

    th,
    td {
        border: 1px solid #999 !important;
        padding: 6px 8px !important;
        vertical-align: top;
    }

    th {
        background: #f3f3f3 !important;
        color: #000 !important;
    }

    th a {
        color: #000 !important;
        text-decoration: none !important;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }

    input,
    select,
    textarea {
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        transform: none !important;
    }

    input[type="checkbox"] {
        transform: scale(1.1);
    }

    .switch .slider {
        display: none !important;
    }

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

    .print-only {
        display: inline !important;
        font-weight: 500;
    }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .container {
        padding: 18px 14px 24px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 20px;
    }

    .page-header-text h2 {
        font-size: 24px;
    }

    .page-header-action {
        width: 100%;
    }

    .page-header-action .print-btn,
    .page-header-action button,
    .page-header-action a {
        width: 100%;
    }

    .nav-wrapper {
        gap: 16px 18px;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 14px 14px;
    }

    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .user-bar {
        justify-content: space-between;
        flex-wrap: wrap;
        white-space: normal;
    }

    .nav-wrapper {
        flex-direction: column;
        gap: 14px;
    }

    .nav-group {
        min-width: 0;
    }

    .nav-group .nav {
        gap: 8px;
    }

    .nav-group .nav a,
    .tab-nav a {
        width: 100%;
        justify-content: center;
    }

    .tab-nav {
        flex-direction: column;
        gap: 8px;
    }

    .card {
        padding: 16px;
        border-radius: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 26px;
    }

    .page-header-text h2 {
        font-size: 22px;
    }

    .page-info,
    .page-header-text p {
        font-size: 13px;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-field {
        max-width: none;
    }

    .search-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .search-actions button,
    .search-actions a {
        width: 100%;
        text-align: center;
    }

    thead {
        display: none;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tbody tr {
        border-bottom: 1px solid #e7edf5;
        padding: 10px 0;
    }

    tbody td {
        border-bottom: none;
        padding: 8px 0;
    }
}

@media (max-width: 520px) {
    .login-card-apple {
        padding: 30px 22px 24px;
        border-radius: 24px;
    }

    .login-logo-apple img {
        max-width: 165px;
    }

    .login-intro-apple h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .login-wrapper-apple {
        padding: 18px 14px 14px;
    }

    .login-card-apple {
        padding: 26px 18px 22px;
        border-radius: 22px;
    }

    .login-logo-apple img {
        max-width: 150px;
    }

    .login-intro-apple h2 {
        font-size: 22px;
    }

    .login-intro-apple p {
        font-size: 13px;
    }

    .login-field-apple input {
        padding: 13px 14px;
        font-size: 14px;
    }

    .login-btn-apple {
        padding: 14px;
        font-size: 14px;
    }

    .login-signature {
        margin-top: 18px;
    }
}

@media (max-width: 900px) {
    .app-sidebar {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .mobile-nav-drawer {
        display: flex;
    }

    .container.app-content {
        padding: 18px 14px 24px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 20px;
    }

    .page-header-text h2 {
        font-size: 24px;
    }

    .page-header-action {
        width: 100%;
    }

    .page-header-action .print-btn,
    .page-header-action button,
    .page-header-action a {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 14px 14px;
    }

    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .user-bar {
        justify-content: space-between;
        flex-wrap: wrap;
        white-space: normal;
    }

    .card {
        padding: 16px;
        border-radius: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 26px;
    }

    .page-header-text h2 {
        font-size: 22px;
    }

    .page-info,
    .page-header-text p {
        font-size: 13px;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-field {
        max-width: none;
    }

    .search-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .search-actions button,
    .search-actions a {
        width: 100%;
        text-align: center;
    }

    .tab-nav {
        flex-direction: column;
        gap: 8px;
    }

    .tab-nav a {
        width: 100%;
        justify-content: center;
    }

    thead {
        display: none;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tbody tr {
        border-bottom: 1px solid #e7edf5;
        padding: 10px 0;
    }

    tbody td {
        border-bottom: none;
        padding: 8px 0;
    }
}