/* ========================================
    SCSD Dienstblatt - Sheriff Gold Theme
   Premium Personnel Management Styles
   ======================================== */

/* ==========================================
    CSS VARIABLES - SCSD SHERIFF THEME
   ========================================== */

:root {
    /* Background Colors */
    --bg-primary: #0a0c10;
    --bg-secondary: #12151c;
    --bg-tertiary: #1a1e28;
    --bg-card: #151922;
    --bg-glass: rgba(20, 24, 32, 0.8);
    
    /* Sheriff Gold Accents */
    --accent-primary: #d4a843;
    --accent-secondary: #e8c46a;
    --accent-dim: rgba(212, 168, 67, 0.1);
    --accent-glow: rgba(212, 168, 67, 0.4);
    
    /* Text Colors */
    --text-bright: #ffffff;
    --text-primary: #e4e8f0;
    --text-secondary: #a8b2c4;
    --text-muted: #6b7a94;
    
    /* Border Colors */
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(212, 168, 67, 0.3);
    --border-gold: rgba(212, 168, 67, 0.4);
    
    /* Status Colors */
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.15);
    --yellow: #f59e0b;
    --yellow-dim: rgba(245, 158, 11, 0.15);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 30px rgba(212, 168, 67, 0.15);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   HEADER
   ========================================== */

.main-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-gold);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 40px rgba(212, 168, 67, 0.05);
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #b8902e 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--bg-primary);
    box-shadow: var(--shadow-gold), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.title-section h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.clock-section {
    text-align: right;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.time {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #b8902e 100%);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(212, 168, 67, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--border-accent);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border-gold);
}

.btn-outline:hover {
    background: var(--accent-dim);
    box-shadow: var(--shadow-gold);
}

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--red);
    color: white;
}

.btn-icon {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-icon:hover {
    border-color: var(--border-accent);
    color: var(--accent-primary);
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
}

/* ==========================================
   STATS BAR
   ========================================== */

.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-gold);
}

.stat-item .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: var(--accent-dim);
    color: var(--accent-primary);
    border: 1px solid var(--border-gold);
}

.stat-item.filled .stat-icon {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-item.empty .stat-icon {
    background: var(--blue-dim);
    color: var(--blue);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   CONTROLS BAR
   ========================================== */

.controls-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--border-gold);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--border-gold);
    color: var(--accent-primary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.page-info span {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ==========================================
   TABLE CONTAINER
   ========================================== */

.table-container {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
}

.roster-table thead {
    background: linear-gradient(180deg, rgba(212, 168, 67, 0.1) 0%, transparent 100%);
}

.roster-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    border-bottom: 1px solid var(--border-gold);
}

.roster-table td {
    padding: 14px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.roster-table tbody tr {
    transition: all 0.2s ease;
}

.roster-table tbody tr:hover {
    background: rgba(212, 168, 67, 0.05);
}

.roster-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.col-dn { width: 80px; }
.col-name { width: 200px; }
.col-rank { width: 160px; }
.col-hired { width: 140px; }
.col-dept { width: 160px; }
.col-actions { width: 100px; text-align: center; }

/* DN Badge */
.dn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 6px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

/* Empty state */
.empty-cell {
    color: var(--text-muted);
    font-style: italic;
}

/* Rank badge */
.rank-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Department badge */
.dept-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--blue-dim);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--blue);
}

/* Actions */
.action-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--accent-dim);
    border-color: var(--border-gold);
    color: var(--accent-primary);
}

/* ==========================================
   LOADING OVERLAY
   ========================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 16, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--accent-primary);
}

.loading-spinner i {
    font-size: 3rem;
}

.loading-spinner span {
    font-size: 1rem;
    font-weight: 500;
}

/* ==========================================
   MODAL
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #090c10 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 0 1px rgba(212, 168, 67, 0.1),
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(212, 168, 67, 0.1);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    background: linear-gradient(180deg, rgba(212, 168, 67, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-gold);
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-bright);
}

.modal-header h3 i {
    color: var(--accent-primary);
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px 14px;
    transition: all 0.3s ease;
    border-radius: var(--radius);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--red);
    border-color: var(--red);
    background: var(--red-dim);
}

.modal-body {
    padding: 28px;
}

/* ==========================================
   FORM STYLES
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label i {
    color: var(--accent-primary);
    font-size: 0.85rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-gold);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: var(--bg-card);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4a843' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.action-right {
    display: flex;
    gap: 12px;
}

/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */

.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 3000;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.notification-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.9), rgba(180, 140, 50, 0.9));
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1200px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .stats-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .main-header {
        padding: 0 16px;
    }
    
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 0;
        gap: 16px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .roster-table {
        min-width: 800px;
    }
}

@media (max-width: 600px) {
    .title-section h1 {
        font-size: 1rem;
    }
    
    .clock-section {
        display: none;
    }
    
    .modal-content {
        margin: 10px;
    }
}
