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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #fff;
}

/* Main content */
main {
    flex: 1;
    padding: 30px 0;
}

h2 {
    margin-bottom: 20px;
    color: #333;
}

h3 {
    margin-bottom: 15px;
    color: #444;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Clock card */
.live-clock {
    font-size: 2.5em;
    font-weight: 700;
    color: #667eea;
    margin: 15px 0;
    font-variant-numeric: tabular-nums;
}

.status {
    font-size: 1em;
    margin-bottom: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Summary stats */
.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.stat {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* Stat card */
.stat-card {
    text-align: center;
}

.stat-card h3 {
    font-size: 2.2em;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    margin-bottom: 15px;
}

/* Forms */
.auth-form {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-large {
    padding: 14px 30px;
    font-size: 1.1em;
    width: 100%;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.85em;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-primary {
    background: #cce5ff;
    color: #004085;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* Empty state */
.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 1.1em;
}

/* Auth link */
.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
}

/* Footer */
.footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 15px 0;
    font-size: 0.85em;
}

/* Filter form */
.filter-form {
    margin: 0;
}

a.btn {
    text-align: center;
}

/* Location */
.location-info {
    font-size: 0.9em;
    margin-bottom: 12px;
    color: #555;
}

.map-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.map-link:hover {
    text-decoration: underline;
}

.no-location {
    color: #aaa;
}

.location-status {
    font-size: 0.85em;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 4px;
}

.location-status.success {
    color: #155724;
    background: #d4edda;
}

.location-status.warning {
    color: #856404;
    background: #fff3cd;
}

/* Map modal */
.map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.map-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.map-close {
    position: absolute;
    top: 10px;
    right: 18px;
    font-size: 28px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    z-index: 1001;
}

.map-close:hover {
    color: #333;
}

.map-container {
    width: 100%;
    height: 450px;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .map-container {
        height: 300px;
    }
}

/* Open session row highlighting */
.row-open {
    background: #fff3cd !important;
}

/* Alert card */
.alert-card {
    border-left: 4px solid #ffc107;
}

.alert-warning h3 {
    color: #856404;
    margin-bottom: 10px;
}

.forgotten-session {
    background: #fff;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
}

.forgotten-session p {
    margin-bottom: 10px;
    font-size: 0.95em;
}

.forgotten-form .form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.forgotten-form .form-group {
    margin-bottom: 0;
    min-width: 200px;
}

.forgotten-form .form-group input {
    padding: 8px 10px;
}

/* Card header with title + button */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    margin-bottom: 0;
}

/* Form modal */
.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    place-items: center;
}

.form-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.form-modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.form-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}

.form-modal-close:hover {
    color: #333;
}
