:root {
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --primary-light: #eff6ff;
    /* Blue 50 */
    --brand-color: #FF9900;
    /* Orange */

    --bg-color: #f3f4f6;
    /* Gray 100 */
    --card-bg: #ffffff;

    --text-main: #111827;
    /* Gray 900 */
    --text-secondary: #4b5563;
    /* Gray 600 */
    --text-muted: #9ca3af;
    /* Gray 400 */

    --border-color: #e5e7eb;
    /* Gray 200 */
    --border-focus: #FF9900;

    --success-color: #059669;
    /* Emerald 600 */
    --success-bg: #d1fae5;
    --error-color: #dc2626;
    /* Red 600 */
    --error-bg: #fee2e2;
    --warning-color: #d97706;
    --warning-bg: #fef3c7;

    /* Spacing & Layout */
    --header-height: 70px;
    --sidebar-width: 260px;
    --container-width: 1200px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-main: 'Outfit',
        system-ui,
        -apple-system,
        sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: 'Colmeak';
    src: url('https://test.naturalium.cz/fonts/Colmeak.otf') format('opentype'),
        url('https://test.naturalium.cz/fonts/Colmeak.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.font-brand {
    font-family: 'Colmeak', serif;
}

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

/* --- Utilities --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.font-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.hidden {
    display: none;
}

.text-brand {
    color: var(--brand-color);
}

.font-bold {
    font-weight: 700;
}

.font-serif {
    font-family: var(--font-heading);
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- Components --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn-danger {
    background-color: white;
    color: var(--error-color);
    border-color: var(--error-color);
}

.btn-danger:hover {
    background-color: var(--error-bg);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-error {
    background-color: var(--error-bg);
    color: #991b1b;
    border-color: #fecaca;
}

/* Tables */
.data-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    text-align: left;
}

.data-table th {
    background-color: #f9fafb;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f9fafb;
}

/* --- Layout Specifics --- */

/* Header */
header {
    background: rgba(255, 255, 255, 0.9);
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

.logo img {
    height: 40px;
    width: auto;
}

header nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

header nav a {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

header nav a:hover {
    color: var(--primary-color);
}

/* Navbar Dropdown Styles (Moved from inline) */
header nav ul li.dropdown-item {
    position: relative;
}

header nav ul li.dropdown-item .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 50;
    border: 1px solid #e2e8f0;
}

header nav ul li.dropdown-item:hover .dropdown-menu {
    display: block;
}

header nav ul li.dropdown-item .dropdown-menu li {
    display: block;
    margin: 0;
}

header nav ul li.dropdown-item .dropdown-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    color: #4a5568;
}

header nav ul li.dropdown-item .dropdown-menu li a:hover {
    background: #f7fafc;
    color: #2b6cb0;
}


/* Main Wrapper */
.main-wrapper {
    padding-top: var(--header-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-bottom: 4rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 5rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), #059669);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Admin/School Dashboard Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: white;
    height: calc(100vh - var(--header-height));
    padding: 2rem 1rem;
    position: fixed;
    left: 0;
    top: var(--header-height);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.admin-content {
    margin-left: var(--sidebar-width);
    padding: 2.5rem;
    width: calc(100% - var(--sidebar-width));
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-main);
}

/* Header Actions (Page Titles + Buttons) */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-actions h1 {
    font-size: 1.8rem;
    margin: 0;
}

.header-actions p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn-nav {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #f3f4f6;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: normal;
}

.btn-nav:hover {
    background-color: #e5e7eb;
    color: #111827 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* --- Mobile Menu --- */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: #FF9900;
    cursor: pointer;
    border: none;
    background: none;
}

.nav-text {
    display: none;
}

/* Mobile Spacer */
.mobile-spacer {
    display: none;
}

@media (max-width: 768px) {
    .nav-text {
        display: inline-block !important;
        margin-left: 0.5rem;
    }

    header {
        padding: 1rem;
        position: relative;
        height: auto;
        flex-wrap: wrap;
        background-color: var(--bg-color) !important;
        /* Force match body bg */
        border-bottom: none !important;
        /* Force remove border */
        backdrop-filter: none !important;
        /* Disable blur */
        box-shadow: none !important;
        /* Disable shadow */
    }

    header .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    header .logo img {
        height: auto;
        max-height: 50px;
        width: auto;
        max-width: 80%;
    }

    header nav {
        width: 100%;
        order: 3;
    }

    header nav ul {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        z-index: 50;
        border-top: 1px solid var(--border-color);
    }

    header nav ul.active {
        display: flex !important;
    }

    header nav ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    header nav ul li:last-child {
        border-bottom: none;
    }

    header nav ul li a {
        display: block;
        padding: 0.4rem 1rem;
        border-radius: 0;
    }

    header nav ul li a:hover {
        background-color: var(--bg-color);
        color: var(--brand-color);
    }

    /* Center Logout Button */
    header nav ul li .btn-nav {
        display: table;
        width: auto;
        margin: 0.5rem auto;
        text-align: center;
    }

    .mobile-menu-btn {
        display: block !important;
        position: absolute;
        right: 1.5rem;
        top: 1.5rem;
    }

    .main-wrapper {
        padding-top: 0;
    }

    .hero {
        padding-top: 0;
        /* Reset padding as spacer handles it */
    }

    .mobile-spacer {
        display: block;
        height: 4rem;
        /* Adjust height as needed */
        width: 100%;
    }
}