/* GLOBAL BOX MODEL FIX */
*,
*::before,
*::after {
    box-sizing: border-box;
}

 
/* Admin UX Refresh (Stage 2) – neutral/business-clean, compact */

:root {
    /* Harmonised palette */
    --primary: #1d4ed8;
    --primary-hover: #1e40af;

    --bg: #f5f7fb;
    --card: #ffffff;

    --text: #111827;
    --muted: #5b6b80;
    --border:  #d8e0ea;

    --danger: #dc2626;
    --success: #15803d;
    --warning: #c26a04;

    --radius: 10px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.05);

    --sp-1: .25rem;
    --sp-2: .5rem;
    --sp-3: .75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;

    --field-h: 40px;
}

/* Layout */
body {
    background: var(--bg);
    color: var(--text);
    font-family: sans-serif;
}

/* Page wrapper: consistent margins */
.admin-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-5);
}

/* Page header: title left, actions right */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}
.admin-page-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: -0.01em;
}

/* Vertical rhythm */
.admin-stack > * + * {
    margin-top: var(--sp-5);
}

/* Cards */
.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-6);
    box-shadow: var(--shadow);
}

/* Notes / info blocks */
.admin-note {
    border-left: 4px solid var(--primary);
    background: #f8fafc;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    height: var(--field-h);
    padding: 0 .95rem;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
}
.btn-secondary {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text);
}
.btn-secondary:hover {
    background: #eef4fb;
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    filter: brightness(0.96);
}
.btn-sm {
    height: 34px;
    padding: 0 .7rem;
    border-radius: 9px;
    font-weight: 600;
}

/* Action row */
.admin-actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Form grid */
.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--sp-5);
}
.admin-field {
    display: flex;
    flex-direction: column;
}
.admin-field label {
    font-weight: bold;
    margin-bottom: var(--sp-2);
    color: var(--text);
}
.admin-field input,
.admin-field select {
    height: var(--field-h);
    padding: 0 .75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.admin-field input:focus,
.admin-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 58, 138, 0.12);
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    overflow:scroll !important;
}
.admin-table th,
.admin-table td {
    padding: .85rem .75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.admin-table tr:hover {
    background: #f7faff;
}
.admin-table .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Utilities */
.u-inline {
    display: inline;
}
.admin-muted {
    color: var(--muted);
}



/* Layout */
main.container {
    max-width: 1120px;
    margin: 1.25rem auto;
    padding: 0 0.9rem;
}

/* Header/nav tighter */
h1 {
    padding: 10px 12px !important;
    font-size: 1.15rem;
    letter-spacing: 0.2px;
}
nav.small {
    padding: 6px 0px 10px 0px !important;
    font-size:1rem;
    font-weight:bold;
}
header a,
nav a {
    margin: 0 0.9rem !important;
}

/* Cards/panels compact */
.card {
    padding: 12px !important;
    margin-bottom: 12px !important;
    overflow-x: scroll;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel {
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
    background: #f7f9fc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    }

/* Forms */
.form-row {
    margin: 0 0 10px 0;
}
.form-row > label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 4px;
    display: block;
}
input,
select,
textarea {
    margin: 0 !important;
    padding: 0.45rem 0.55rem !important;
    border-radius: 8px !important;
    font-size: 0.95rem;
}
input[type = "checkbox"] {
    width: auto !important;
}

/* Buttons */
button,
.btn {
    margin: 2px !important;
    padding: 10px !important;
    border-radius: 9px !important;
}
button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Tables compact */
table {
    border-radius: var(--radius);
}
th,
td {
    padding: 0.45rem 0.6rem !important;
    vertical-align: top;
}
th {
    font-size: 0.78rem !important;
}
td.small,
th.small,
.small {
    font-size: 0.84rem;
}
code {
    font-size: 0.85em;
}

/* Scroll containers */
.scroll {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

/* Messages */
.err {
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    margin: 10px 0;
}
.msg,
.notice {
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--text);
    margin: 10px 0;
}

/* Conservative status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    white-space: nowrap;
}
.badge--success {
    border-color: rgba(22, 163, 74, .35);
    color: #166534;
    background: rgba(22, 163, 74, .08);
}
.badge--info {
    border-color: rgba(37, 99, 235, .35);
    color: #1d4ed8;
    background: rgba(37, 99, 235, .08);
}
.badge--neutral {
    border-color: rgba(71, 85, 105, .35);
    color: #334155;
    background: rgba(71, 85, 105, .08);
}
.badge--danger {
    border-color: rgba(220, 38, 38, .35);
    color: #991b1b;
    background: rgba(220, 38, 38, .08);
}

/* Small helpers */
.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.row.gap-sm {
    gap: 8px;
}


/* Layout hardening for flex/grid rows */
.form-row {
    min-width: 0;
}
input,
select,
textarea {
    max-width: 100%;
}


/* Flash messages */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    margin: 10px 0 12px 0;
}
.flash .flash-title {
    font-weight: 700;
    font-size: 13px;
    margin: 0 0 2px 0;
}
.flash .flash-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
}
.flash-success {
    background: #e6f4ea;
    border-color: #cfead7;
    color: #1e7d34;
}
.flash-warning {
    background: #fff4e5;
    border-color: #ffe0b2;
    color: #8a4b00;
}
.flash-error {
    background: #fde7e9;
    border-color: #f8c7cc;
    color: #a61c1c;
}
.flash-info {
    background: #eef2ff;
    border-color: #dbe4ff;
    color: #1f3a8a;
}

/* Dashboard fine tuning */
ul.menu * {
    text-decoration: none;

}




/* UX fine-tuning */
.info-box {
    padding: 12px !important;
    margin-bottom: 12px !important;
    background: #eef5ff !important;
    border: 1px solid #d7e3fb !important;
    border-radius: var(--radius);
}
.readonly-field {
    background-color: #f5f7fa !important;
    border: 1px solid #d0d7de !important;
    color: #334155 !important;
}
.success-note {
    margin-top: 6px;
    color: #166534;
    font-size: 0.84rem;
}
.action-box {
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: var(--radius);
    background: #f8fafc;
    margin-top: 12px;
}
.section-title {
    margin-bottom: 10px;
}
.inline-toggle-area[hidden] {
    display: none !important;
}


.subtle {
    font-size: 0.9em;
    color: #555;
    margin: 6px 0 0 0;
}


/* Lizenzübersicht kompakter und besser lesbar */
.licence-overview-table {
    table-layout: fixed;
}
.licence-overview-table th,
.licence-overview-table td {
    word-break: break-word;
}
.licence-overview-table .col-select {
    width: 42px;
    text-align: center;
}
.table-primary {
    font-weight: 600;
    color: var(--text);
}
.table-meta {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
}
.licence-overview-table td {
    vertical-align: top;
}
.licence-overview-table code {
    white-space: pre-wrap;
}
@media (max-width: 1100px) {
    .licence-overview-table {
        min-width: 980px;
    }
}


.licence-filter-panel {
  margin-top: 12px;
  margin-bottom: 12px;
}

.licence-filter-panel__header {
  margin-bottom: 10px;
}

.licence-filter-panel__title {
  margin: 0 0 4px 0;
}

.licence-filter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 0;
}

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

.licence-filter-active-note {
  margin: 10px 0 0 0;
}


/* Design harmonisation */
html {
    background: var(--bg);
}
body {
    line-height: 1.45;
}

h1 {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    margin: 0;
}

nav.small {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    background: #f8fbff;
    border-bottom: 1px solid var(--border);
    padding-left: 12px !important;
    padding-right: 12px !important;
}

nav.small a {
    margin: 0 !important;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
}

nav.small a:hover {
    background: #eaf2ff;
    color: var(--primary);
}

.page-topbar {
    margin-bottom: var(--sp-4);
}

.admin-card,
.card,
.panel,
.scroll,
.action-box,
.info-box,
.flash {
    border-color: var(--border) !important;
}

.card {
    border-width: 1px !important;
}

.admin-note,
.info-box,
.flash-info {
    background: #f3f7ff !important;
}

.btn-primary {
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.14);
}

.btn-secondary {
    background: #ffffff;
}

.btn-danger {
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.14);
}

.admin-table th {
    background: #f8fbff;
}

.admin-table tr:hover {
    background: #f8fbff;
}

.flash-success {
    background: #edf9f0;
    border-color: #ccead4;
    color: #166534;
}
.flash-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}
.flash-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.flash-info {
    border-color: #cfe0ff;
    color: #1d4ed8;
}

.badge--success {
    border-color: rgba(22, 163, 74, .25);
    color: #166534;
    background: rgba(22, 163, 74, .08);
}
.badge--info {
    border-color: rgba(37, 99, 235, .25);
    color: #1d4ed8;
    background: rgba(37, 99, 235, .08);
}
.badge--neutral {
    border-color: rgba(100, 116, 139, .25);
    color: #475569;
    background: rgba(100, 116, 139, .08);
}
.badge--danger {
    border-color: rgba(220, 38, 38, .25);
    color: #b91c1c;
    background: rgba(220, 38, 38, .08);
}

.subtle,
.form-row > label,
.admin-muted,
.table-meta {
    color: var(--muted);
}


/* Variant polish */
header, nav.small {
    background: transparent;
}
header a, nav a {
    color: var(--primary);
}
header a:hover, nav a:hover {
    color: var(--primary-hover);
}
.card, .admin-card, .panel, .scroll {
    overflow-x: auto;
}
.admin-table th {
    background: transparent;
}

.btn-primary {
    box-shadow: 0 6px 14px rgba(29, 78, 216, 0.14);
}
.admin-page-title {
    letter-spacing: -0.02em;
}
.badge--info {
    border-color: rgba(29, 78, 216, .28);
    color: #1d4ed8;
    background: rgba(29, 78, 216, .07);
}


.customers-table {
    table-layout: fixed;
}
.customers-table .col-customer-name {
    width: 65%;
    text-align:left;
}
.customers-table .col-actions {
    width: 35%;
    min-width: 240px;
}
.customers-table .customer-name-cell {
    width: 65%;
    word-break: break-word;
}
.customers-table .customer-actions-cell {
    width: 35%;
}
.customers-table .customer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .6rem;
    flex-wrap: nowrap;
}
.customers-table .customer-action-form {
    display: inline-flex;
    margin: 0;
}
.customers-table .customer-status-btn {
    cursor: default;
}
@media (max-width: 720px) {
    .customers-table .col-customer-name {
        width: 55%;
    }
    .customers-table .col-actions {
        width: 45%;
        min-width: 200px;
    }
    .customers-table .customer-actions {
        gap: .4rem;
    }
}
