:root {
    --bg: #ffffff;
    --text: #111111;
    --panel-bg: #ffffff;
    --border: #dddddd;
    --border-light: #eeeeee;
    --th-bg: #f7f7f7;
    --row-hover: #fafafa;
    --footer-text: #666666;
    --dropdown-item-hover: #f7f7f7;
    --modal-overlay: rgba(0, 0, 0, 0.45);
    --scrollbar-thumb: #c7c7c7;
    --scrollbar-thumb-hover: #999999;
    --input-bg: #ffffff;
    --input-text: #111111;
    --input-border: #cccccc;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-strong: rgba(0, 0, 0, 0.15);
    --link-color: #0275d8;
}

body.dark-mode {
    --bg: #181818;
    --text: #e6e6e6;
    --panel-bg: #232323;
    --border: #3a3a3a;
    --border-light: #2d2d2d;
    --th-bg: #2a2a2a;
    --row-hover: #2a2a2a;
    --footer-text: #a0a0a0;
    --dropdown-item-hover: #2d2d2d;
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --scrollbar-thumb: #4a4a4a;
    --scrollbar-thumb-hover: #666666;
    --input-bg: #2a2a2a;
    --input-text: #e6e6e6;
    --input-border: #4a4a4a;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.6);
    --link-color: #4dabf7;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
input[type="number"],
select,
textarea {
    background: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--input-border);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}

.top-header h1 {
    margin: 0;
    font-size: 32px;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 18px;
}

.container {
    max-width: 1300px;
    margin: 0;
    padding: 40px 32px;
}

.container-wide {
    padding: 40px 32px;
}

.cards {
    display: flex;
    gap: 18px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.card {
    width: 210px;
    padding: 24px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
}

.card:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.card-title {
    font-size: 18px;
    margin-bottom: 12px;
}

.card-number {
    font-size: 38px;
    line-height: 1;
}

.ok { background: #5cb85c; }
.thirty { background: #f0ad4e; }
.seven { background: #d9534f; }
.expired { background: #555; }

.add-card {
    background: #0275d8;
}

.add-card:hover {
    background: #025aa5;
}

.table-wrapper {
    background: var(--panel-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px var(--shadow);
}

table {
    border-collapse: collapse;
    width: 100%;
    background: var(--panel-bg);
    color: var(--text);
}

th {
    background: var(--th-bg);
    text-align: left;
    padding: 16px;
    font-size: 15px;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 15px;
}

tr:hover {
    background: var(--row-hover);
}

td.days {
    text-align: center;
    font-weight: bold;
    border-radius: 6px;
}

table a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: bold;
}

table a:hover {
    text-decoration: underline;
}

.btn,
.logout-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: bold;
    margin-right: 8px;
}

.link-danger {
    color: #d9534f;
}

.logout-btn,
.btn-back {
    background: #d9534f;
}

.logout-btn:hover,
.btn-back:hover {
    background: #c9302c;
}

.btn-export {
    background: #5cb85c;
}

.btn-export:hover {
    background: #449d44;
}

.btn-audit {
    background: #0275d8;
}

.btn-admin {
    background: #5bc0de;
}
.btn-archive{
    background:#ffc107;
    color:#212529;
}

.btn-archive:hover{
    background:#e0a800;
}
footer {
    border-top: 1px solid var(--border);
    padding: 24px 32px;
    color: var(--footer-text);
    margin-top: 80px;
}

.audit-badge {
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    min-width: 120px;
    text-align: center;

}

.audit-login {
    background: #5cb85c;
}

.audit-logout {
    background: #999;
}

.audit-add {
    background: #0275d8;
}

.audit-update {
    background: #f0ad4e;
}

.audit-delete {
    background: #d9534f;

}
.audit-send {
    background: #f51dc6;
}
.audit-complete {
    background: #28fc08;
}
.audit-user {
    background: #6f42c1;
}
.audit-import {
    background: #0275d8;
}
.audit-archive{
    background:#fff3cd;
    color:#856404;
}
.audit-restore{
    background:#d1e7dd;
    color:#0f5132;
}

.audit-badge {
    min-width: 120px;
    text-align: center;
}
.audit-move {
    background: #0dcaf0;
    color: #000;
}
.audit-manual {
    background: #6c757d;
    color: white;
}
.audit-duplicate {
    background: #0275d8;
    color: #28fc08;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

@keyframes blink {
    0%   { opacity: 1; }
    50%  { opacity: 0.2; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 1s infinite;
}
.form-table th {
    width: 170px !important;
    white-space: nowrap;
    vertical-align: top;
}

.form-table td {
    width: auto;
}

.password-ok {
    color: #5cb85c;
    font-weight: bold;
}

.password-warning {
    color: #f0ad4e;
    font-weight: bold;
}

.password-danger {
    color: #d9534f;
    font-weight: bold;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.logo-link {
    color: inherit;
    text-decoration: none;
}

.logo-link:hover {
    text-decoration: none;
    opacity: 0.85;
}
.logo-link:hover {
    color: var(--link-color);
    transition: color 0.2s ease;
}
.profile-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.profile-link:hover {
    color: var(--link-color);
}

.import-steps {
    display: flex;
    gap: 12px;
    margin: 20px 0 30px;
    max-width: 1000px;
}

.import-step {
    flex: 1;
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--th-bg);
    color: var(--footer-text);
    font-weight: bold;
    text-align: center;
}

.import-step.done {
    background: #5cb85c;
    color: white;
}

.import-step.active {
    background: #0275d8;
    color: white;
}
.alert-error{
    background:#f8d7da;
    border:1px solid #dc3545;
    color:#721c24;
    padding:15px;
    border-radius:6px;
    margin:15px 0;
}

.alert-error ul{
    margin:10px 0 10px 20px;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.inline-form button {
    font: inherit;
}
th .table-header-link{
   color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

th .table-header-link:hover{
   color: var(--link-color);
}

/* Hlavičkové filtry tabulky */

.table-wrapper {
    overflow: visible;
}

.filter-header {
    position: relative;
}

.filter-header-content {
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-header-button {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: bold;
}

.filter-clear {
    color: #d9534f !important;
    text-decoration: none !important;
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
}

.filter-clear:hover {
    color: #c9302c !important;
    text-decoration: none !important;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% - 4px);
    left: 10px;
    z-index: 1000;

    min-width: 230px;
    max-width: 360px;

    max-height: 320px;   /* cca 10–12 položek */
    overflow-y: auto;
    overflow-x: hidden;

    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    box-shadow: 0 6px 18px var(--shadow-strong);
}

.filter-dropdown[hidden] {
    display: none;
}

table .filter-dropdown-item {
    display: flex;
    align-items: center;
    gap: 7px;

    padding: 9px 13px;
    color: var(--text);
    text-decoration: none;
    font-weight: normal;
    white-space: nowrap;
}

table .filter-dropdown-item:hover {
    color: var(--link-color);
    background: var(--dropdown-item-hover);
    text-decoration: none;
}

table .filter-dropdown-item.selected {
    font-weight: bold;
}

.filter-check {
    display: inline-block;
    width: 14px;
    flex: 0 0 14px;
    color: var(--link-color);
}
.filter-dropdown::-webkit-scrollbar {
    width: 8px;
}

.filter-dropdown::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.filter-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}
.filter-dropdown-empty {
    display: block;
    padding: 10px 13px;
    color: var(--footer-text);
    font-weight: normal;
    white-space: nowrap;
}

.login-message {
    margin-bottom: 14px;
    padding: 11px 13px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.login-message-warning {
    color: #7a4b00;
    background: #fff3cd;
    border: 1px solid #ffe69c;
}
.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.confirm-modal-box {
    background: var(--panel-bg);
    max-width: 420px;
    width: 90%;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 6px 30px var(--shadow-strong);
}

.confirm-modal-message {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 20px;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-modal-actions button {
    padding: 9px 18px;
    border-radius: 5px;
    border: 0;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.confirm-modal-no {
    background: var(--th-bg);
    color: var(--text);
}

.confirm-modal-yes {
    background: #dc3545;
    color: white;
}

.status-badge {
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    min-width: 90px;
    text-align: center;
}

.status-ok {
    background: #5cb85c;
}

.status-warn {
    background: #f0ad4e;
}

.status-bad {
    background: #d9534f;
}

.nav-active {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.55);
}

.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: var(--footer-text);
    font-style: italic;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    margin-right: 0;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    min-width: 200px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 6px 20px var(--shadow-strong);
    padding: 6px 0;
}

.nav-dropdown-menu[hidden] {
    display: none;
}

.nav-dropdown-item {
    display: block;
    padding: 9px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: normal;
}

.nav-dropdown-item:hover {
    background: var(--dropdown-item-hover);
    color: var(--link-color);
}

.nav-dropdown-item.nav-active {
    font-weight: bold;
    box-shadow: none;
    color: var(--link-color);
}

.tag-input-widget {
    position: relative;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--th-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 13px;
}

.tag-chip-remove {
    color: var(--footer-text);
    text-decoration: none;
    font-weight: bold;
    line-height: 1;
}

.tag-chip-remove:hover {
    color: #d9534f;
}

.tag-text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--input-text);
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 6px 18px var(--shadow-strong);
    max-height: 220px;
    overflow-y: auto;
}

.tag-suggestion-item {
    padding: 9px 13px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.tag-suggestion-item:hover,
.tag-suggestion-item.active {
    background: var(--dropdown-item-hover);
    color: var(--link-color);
}

.tag-pill {
    display: inline-block;
    background: var(--th-bg);
    border: 1px solid var(--border);
    color: var(--footer-text);
    border-radius: 12px;
    padding: 2px 9px;
    font-size: 12px;
    margin: 2px 3px 0 0;
    text-decoration: none;
}

.tag-pill:hover {
    color: var(--link-color);
}

.header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    background: #d9534f;
    color: white;
    border-radius: 13px;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
}

.header-badge:hover {
    background: #c9302c;
}
