@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #3a954f;       
    --primary-hover: #4ade80; 
    --bg-dark: #0f172a;       
    --text-main: #f8fafc;     
    --text-muted: #94a3b8;    
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- ANIMATIONS --- */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-enter {
    animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- LOGIN SCREEN --- */
.login-body {
    background: linear-gradient(rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0.9)), url('../assets/bg-elevator.jpg') center/cover no-repeat fixed;
}

.bg-graphic {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
}
.bg-graphic.one { top: -100px; left: -100px; width: 400px; height: 400px; background: rgba(58, 149, 79, 0.15); }
.bg-graphic.two { bottom: -150px; right: -50px; width: 500px; height: 500px; background: rgba(25, 88, 40, 0.08); }

.container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--glass-shadow);
}

.logo-container { text-align: center; margin-bottom: 2rem; }
.logo-container .badge { display: inline-block; margin-bottom: 0.75rem; }
.logo-container h1 { font-size: 1.8rem; font-weight: 700; color: white; }
.logo-container h1 span { color: var(--primary); }
.logo-container p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* --- FORMS & BUTTONS --- */
.badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(58, 149, 79, 0.2);
}
.form-control::placeholder { color: #475569; }
.form-control option { background: #1e293b; color: white; }

.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 149, 79, 0.3);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; border-radius: 6px; }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); color: #f87171; box-shadow: none; }
.btn-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-main); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); box-shadow: none; }

.login-card .btn {
    width: 100%;
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.options a { color: var(--primary); text-decoration: none; }
.options a:hover { text-decoration: underline; }

.footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}
.footer a { color: var(--text-muted); text-decoration: underline;}

.app-body {
    background: url('../assets/bg-elevator.jpg') center/cover no-repeat fixed;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    /* Transparent enough to see the image, blurred enough not to distract */
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid var(--glass-border);
    color: white;
}
.sidebar-header span { color: var(--primary); }

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.875rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
}
.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left: 3px solid var(--primary);
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Vlastní krásné posuvníky (Scrollbars) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.topbar {
    height: 70px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.page-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 2rem;
}

/* --- CARDS & TABLES --- */
.card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.7);
}
.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-hover);
    margin-bottom: 0.5rem;
}
.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.table-toolbar h2 {
    margin-bottom: 0;
}
.table-search {
    width: 300px;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
}
.table-search::placeholder {
    color: var(--text-muted);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table th, .data-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.data-table th {
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    user-select: none;
    position: relative;
}
.data-table th:hover {
    color: white;
}
.data-table th.sort-asc::after {
    content: " \25B2"; /* Up arrow */
    font-size: 0.7em;
    margin-left: 5px;
}
.data-table th.sort-desc::after {
    content: " \25BC"; /* Down arrow */
    font-size: 0.7em;
    margin-left: 5px;
}
.data-table tr {
    transition: background 0.2s ease;
}
.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    padding: 0.25rem 0.75rem;
    background: rgba(58, 149, 79, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: toastEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards, toastExit 0.4s ease 4s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.error {
    border-left-color: #ef4444;
}
@keyframes toastEnter {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastExit {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-content { transform: translateY(0) scale(1); opacity: 1; }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 1rem;}
.modal-header h2 { font-size: 1.25rem; font-weight: 600; color: white; }
.close-modal { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; transition: color 0.2s; }
.close-modal:hover { color: white; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .app-wrapper { flex-direction: column; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--glass-border); }
    .sidebar-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .nav-item { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .nav-item:hover, .nav-item.active { border-left: none; border-bottom: 3px solid var(--primary); }
    .topbar { flex-direction: column; height: auto; padding: 1rem; gap: 1rem; text-align: center;}
    .form-grid { grid-template-columns: 1fr; }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}
