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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #334155;
    min-height: 100vh;
    line-height: 1.5;
}

/* Header */
.admin-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-header .brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.admin-header .brand span {
    color: #3b82f6;
}

.admin-nav {
    display: flex;
    gap: 4px;
}

.admin-nav a {
    color: #64748b;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-nav a:hover {
    color: #334155;
    background: #f1f5f9;
}

.admin-nav a.active {
    color: #3b82f6;
    background: #eff6ff;
}

.admin-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-actions a {
    color: #64748b;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-actions a:hover {
    color: #334155;
    background: #f1f5f9;
}

.admin-actions a.logout {
    color: #dc2626;
}

.admin-actions a.logout:hover {
    background: #fef2f2;
}

/* Layout */
.admin-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-box {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    transition: box-shadow 0.2s;
}

.stat-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stats-row a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-box .stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 8px;
}

.stat-box .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-box.highlight {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #fff);
}

.stat-box.highlight .stat-value {
    color: #3b82f6;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Visitor / Employee row */
.person-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.person-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.person-avatar.out {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}

.person-info strong {
    display: block;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
}

.person-info small {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #fff;
    color: #334155;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background: #fff;
    color: #dc2626;
    border-color: #fecaca;
}

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

.btn-success {
    background: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #94a3b8;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters-bar .form-group {
    margin-bottom: 0;
}

.filters-bar select,
.filters-bar input {
    min-width: 160px;
}

/* Messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Two column layout */
.two-col {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 32px;
}

/* Page title */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #94a3b8;
}

.empty-state p {
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        padding: 0 16px;
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
        gap: 8px;
    }
    
    .admin-layout {
        padding: 16px;
    }
    
    .two-col {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-bar select,
    .filters-bar input {
        width: 100%;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}
