:root {
    --bg: #f6f7f9;
    --card: #fff;
    --text: #222;
    --muted: #666;
    --border: #e3e6ea;
    --accent: #207245;
    --accent-2: #3b82f6;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --success-bg: #e6f4ea;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* HEADER */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand img {
    height: 56px;
    width: auto;
    display: block;
}

.header-title {
    text-align: center;
    line-height: 1.2;
    font-weight: 800;
}

.header-title .uni {
    font-size: 18px;
    letter-spacing: .2px;
}

.header-title .sub {
    margin-top: 2px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

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

.user-badge {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-badge a {
    color: #3730a3;
    text-decoration: underline;
}

/* ADMIN NAV (Fakulty | Skupiny | Administrátori) */
.admin-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    flex-wrap: wrap;
}

.admin-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: var(--accent-2);
    border: 1px solid transparent;
}

.admin-nav a:hover {
    filter: brightness(.94);
}

.admin-nav a.active {
    background: #1d4ed8;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5);
}

/* PAGE HEADING (centered title above admin tables/forms) */
.page-heading {
    text-align: center;
    margin: 0 0 18px;
}

/* LAYOUT */
.wrap {
    max-width: 960px;
    margin: 28px auto;
    padding: 0 16px;
}

.wrap.wide {
    max-width: 1200px;
}

.wrap.full {
    max-width: 100%;
    width: 96%;
}

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
}

.card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.card p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.45;
}

.note {
    font-size: 14px;
    color: var(--muted);
    margin-top: 6px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 16px;
}

.actions.end {
    justify-content: flex-end;
}

.actions.center {
    justify-content: center;
}

.table-frame {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .04);
    padding: 16px;
    overflow-x: auto;
}

.row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
}

.btn i {
    font-size: 16px;
}

.btn.secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.btn.blue {
    background: var(--accent-2);
    color: #fff;
}

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

.btn.small {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.btn:hover {
    filter: brightness(.96);
}

/* ALERTS */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert.success {
    background: var(--success-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.alert.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert.warning {
    background: #fff7e6;
    color: #92400e;
    border: 1px solid #f59e0b;
    text-align: center;
}

/* FORMS */
.form-card {
    max-width: 560px;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

.field textarea {
    min-height: 80px;
    resize: vertical;
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* TABLE */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table.data-table th,
table.data-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

table.data-table th {
    background: var(--bg);
    font-weight: 700;
}

/* DataTables sort indicators - independent of DataTables' own default skin,
   table.dataTable is the class DataTables itself adds on init. */
table.dataTable thead th {
    position: relative;
    padding-right: 24px !important;
    cursor: pointer;
}

table.dataTable thead th::after {
    content: '\2195';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .35;
    font-size: 12px;
}

table.dataTable thead th[aria-sort="ascending"]::after {
    content: '\2191';
    opacity: 1;
}

table.dataTable thead th[aria-sort="descending"]::after {
    content: '\2193';
    opacity: 1;
}

table.data-table td form {
    display: inline;
}

/* responsive */
@media (max-width:640px) {
    .brand img {
        height: 44px;
    }

    .header-title .uni {
        font-size: 16px;
    }

    .header-title .sub {
        font-size: 12px;
    }
}
