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

:root {
    --bg: #f5f5f3;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-solid: #ffffff;
    --surface-hover: rgba(0, 0, 0, 0.02);
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);
    --text: #1a1a2e;
    --text-secondary: #666;
    --text-muted: #999;
    --primary: #1a1a2e;
    --primary-hover: #333;
    --accent: #3b82f6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-blur: blur(20px);
}

body {
    font-family: system-ui, -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Nav */
.nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.3px;
}

.logo-mark {
    width: 8px;
    height: 8px;
    background: var(--text);
    border-radius: 2px;
    display: inline-block;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    color: var(--text-secondary);
    font-size: 13px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-hover);
}

/* Main */
.main {
    padding: 32px 0 64px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

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

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

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

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
}

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

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-block {
    width: 100%;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26, 26, 46, 0.06);
}

textarea.form-control {
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Alert */
.alert {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Positions Grid */
.positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.position-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.position-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.position-dept {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.position-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.position-salary {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.position-card .btn {
    margin-top: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
    background: var(--glass-bg);
    border-radius: var(--radius);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(6px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

/* Admin Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
}

.sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all 0.2s;
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.sidebar-link.active {
    color: #fff;
    background: var(--primary);
    font-weight: 500;
}

.content {
    min-width: 0;
}

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

.content-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* Stats */
.stats-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.stat-num {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-pending .stat-num { color: var(--warning); }
.stat-approved .stat-num { color: var(--success); }
.stat-rejected .stat-num { color: var(--danger); }

/* Filter */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    background: var(--glass-bg);
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
}

.filter-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--glass-bg);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.filter-search {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.filter-search .form-control {
    width: 200px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.filter-search .form-control:focus {
    border-color: var(--primary);
    outline: none;
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

/* Table */
.table-wrapper {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

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

.table tr:hover td {
    background: var(--surface-hover);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

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

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

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.action-btns {
    display: flex;
    gap: 6px;
}

/* Detail */
.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table td {
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.detail-label {
    color: var(--text-muted);
    width: 90px;
    font-size: 13px;
}

.detail-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.detail-section h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

.detail-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-wrapper {
    width: 100%;
    max-width: 360px;
    padding: 24px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 12px;
}

.login-form .btn-block {
    margin-top: 8px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Login enhancements */
.login-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.login-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
}

.lockout-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    color: #92400e;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Button hover enhancements */
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.2);
}

.btn-success:hover {
    transform: translateY(-1px);
}

.btn-danger:hover {
    transform: translateY(-1px);
}

/* Table row transitions */
.table tr {
    transition: background 0.15s;
}

/* Card hover effect */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Smooth tab transitions */
.tab-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Badge animations */
.badge {
    transition: all 0.15s;
}

/* Form focus ring */
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 26, 46, 0.06);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        display: flex;
        gap: 4px;
        margin-bottom: 16px;
    }
    
    .stats-row {
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    .positions-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-wrap: wrap;
    }
    
    .filter-search {
        margin-left: 0;
        width: 100%;
    }
    
    .filter-search .form-control {
        flex: 1;
        width: auto;
    }
}

.text-muted {
    color: var(--text-muted);
}
