/* assets/css/style.css */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --bg-dark: #0f0f23;
    --bg-card: #1a1a3e;
    --bg-input: #252550;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --success: #00b894;
    --danger: #e74c3c;
    --warning: #fdcb6e;
    --info: #74b9ff;
    --border: #2d2d5e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== LOGIN ===== */
.login-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
}

.login-card {
    background: var(--bg-card); padding: 50px 40px; border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.5); width: 100%; max-width: 430px;
    border: 1px solid var(--border);
}

.login-card h1 {
    text-align: center; margin-bottom: 8px; font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.login-card .subtitle {
    text-align: center; color: var(--text-secondary); margin-bottom: 35px; font-size: 14px;
}

.login-icon { text-align: center; font-size: 64px; margin-bottom: 20px; }

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block; margin-bottom: 8px; font-weight: 600; font-size: 13px;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    width: 100%; padding: 13px 16px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 14px; background: var(--bg-input);
    color: var(--text-primary); transition: all 0.3s ease; outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.form-group select option { background: var(--bg-input); color: var(--text-primary); }
.form-group textarea { resize: vertical; min-height: 80px; }

.form-group input[type="file"] {
    width: 100%; padding: 12px; border: 2px dashed var(--border);
    border-radius: 12px; background: var(--bg-input); color: var(--text-secondary);
    cursor: pointer; transition: all 0.3s; font-size: 13px;
}

.form-group input[type="file"]:hover,
.form-group input[type="file"]:focus { border-color: var(--primary); }

.form-hint { display: block; margin-top: 5px; font-size: 11px; color: var(--text-secondary); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px; border: none; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.3s ease; text-decoration: none;
    color: white; font-family: inherit;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.btn-success { background: linear-gradient(135deg, #00b894, #00a085); }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.btn-warning { background: linear-gradient(135deg, #f39c12, #e67e22); color: #1a1a2e; }
.btn-secondary { background: linear-gradient(135deg, #636e72, #2d3436); }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 15px 32px; font-size: 15px; width: 100%; justify-content: center; }

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(26,26,62,0.95); padding: 0 30px;
    display: flex; justify-content: space-between; align-items: center;
    height: 68px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100; backdrop-filter: blur(20px);
}

.navbar-brand {
    font-size: 20px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; text-decoration: none; letter-spacing: -0.5px;
}

.navbar-nav { display: flex; align-items: center; gap: 20px; list-style: none; }

.navbar-nav .user-info {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-secondary); font-size: 13px;
}

.avatar-nav {
    width: 36px; height: 36px; border-radius: 50%;
    overflow: hidden; border: 2px solid var(--primary); flex-shrink: 0;
}

.avatar-nav img { width: 100%; height: 100%; object-fit: cover; }

.avatar-placeholder {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: white; flex-shrink: 0;
}

/* ===== MAIN ===== */
.main-content { max-width: 1400px; margin: 25px auto; padding: 0 30px; }

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; flex-wrap: wrap; gap: 15px;
}

.page-header h2 { font-size: 26px; font-weight: 700; }
.page-header p { color: var(--text-secondary); font-size: 13px; margin-top: 3px; }

/* ===== STATS ===== */
.stats-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px; margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card); padding: 22px; border-radius: 16px;
    border: 1px solid var(--border); display: flex;
    align-items: center; gap: 15px; transition: all 0.3s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

.stat-icon.blue { background: rgba(102,126,234,0.15); }
.stat-icon.green { background: rgba(0,184,148,0.15); }
.stat-icon.red { background: rgba(231,76,60,0.15); }
.stat-icon.orange { background: rgba(243,156,18,0.15); }

.stat-card .stat-info h3 { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-card .stat-info p { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

/* ===== TABLE ===== */
.table-container {
    background: var(--bg-card); border-radius: 16px;
    border: 1px solid var(--border); overflow: hidden;
}

.table-header {
    padding: 20px 25px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid var(--border);
    flex-wrap: wrap; gap: 15px;
}

.table-header h3 { font-size: 16px; }

.search-box { position: relative; }

.search-box input {
    padding: 10px 16px 10px 38px; border: 2px solid var(--border);
    border-radius: 10px; background: var(--bg-input); color: var(--text-primary);
    font-size: 13px; outline: none; width: 260px; transition: all 0.3s;
}

.search-box input:focus { border-color: var(--primary); width: 300px; }
.search-box::before { content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; }

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 1000px; }

table thead th {
    padding: 14px 16px; text-align: left; font-size: 11px;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-secondary); background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}

table tbody td {
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 13px; vertical-align: middle;
}

table tbody tr { transition: background 0.2s; }
table tbody tr:hover { background: rgba(102,126,234,0.04); }
table tbody tr:last-child td { border-bottom: none; }

.user-cell { display: flex; align-items: center; gap: 12px; }

.user-cell img {
    width: 40px; height: 40px; border-radius: 12px;
    object-fit: cover; border: 2px solid var(--border); flex-shrink: 0;
}

.user-cell .user-placeholder {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; color: white; flex-shrink: 0;
}

.user-cell .user-details { min-width: 0; }
.user-cell .user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-cell .user-nik { font-size: 11px; color: var(--text-secondary); font-family: monospace; }

.badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.3px; white-space: nowrap;
}

.badge-admin { background: rgba(102,126,234,0.15); color: var(--primary); }
.badge-user { background: rgba(0,184,148,0.15); color: var(--success); }
.badge-position { background: rgba(116,185,255,0.12); color: var(--info); font-size: 10px; text-transform: none; }
.badge-division { background: rgba(253,203,110,0.12); color: var(--warning); font-size: 10px; text-transform: none; }

.sig-thumb {
    max-width: 70px; max-height: 35px; border-radius: 5px;
    background: white; padding: 2px; border: 1px solid var(--border);
}

.no-data { color: var(--text-secondary); font-size: 11px; font-style: italic; }

/* ===== TOGGLE SWITCH ===== */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #2d2d5e; border-radius: 26px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toggle-slider::before {
    content: ''; position: absolute; height: 20px; width: 20px;
    left: 3px; bottom: 3px; background: white; border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: linear-gradient(135deg, var(--success), #00a085); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* ===== ACTIONS ===== */
.actions { display: flex; gap: 6px; }

.action-btn {
    width: 34px; height: 34px; border: none; border-radius: 9px;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 13px; transition: all 0.3s;
    text-decoration: none;
}

.action-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.action-btn.edit { background: rgba(102,126,234,0.15); color: var(--primary); }
.action-btn.delete { background: rgba(231,76,60,0.15); color: var(--danger); }

/* ===== FORM CARD ===== */
.form-card {
    background: var(--bg-card); border-radius: 16px;
    border: 1px solid var(--border); overflow: hidden;
}

.form-card-header {
    padding: 22px 28px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}

.form-card-header .icon { font-size: 22px; }
.form-card-header h3 { font-size: 18px; }
.form-card-body { padding: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row.three-col { grid-template-columns: 1fr 1fr 1fr; }

.form-card-footer {
    padding: 18px 28px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
    background: rgba(255,255,255,0.01);
}

/* ===== FILE PREVIEW ===== */
.photo-preview {
    width: 110px; height: 110px; border-radius: 16px;
    border: 3px dashed var(--border); display: flex;
    align-items: center; justify-content: center; overflow: hidden;
    background: var(--bg-input); transition: border-color 0.3s; flex-shrink: 0;
}

.photo-preview:hover { border-color: var(--primary); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .placeholder-text { color: var(--text-secondary); font-size: 11px; text-align: center; line-height: 1.4; }

.signature-preview {
    width: 180px; height: 90px; border-radius: 12px;
    border: 3px dashed var(--border); display: flex;
    align-items: center; justify-content: center; overflow: hidden;
    background: var(--bg-input); flex-shrink: 0;
}

.signature-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

.remove-file {
    display: flex; align-items: center; gap: 5px;
    margin-top: 8px; cursor: pointer; font-size: 12px; color: var(--danger);
}

.remove-file input[type="checkbox"] { accent-color: var(--danger); }

/* ===== ALERT ===== */
.alert {
    padding: 14px 20px; border-radius: 12px; margin-bottom: 20px;
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; animation: slideDown 0.3s ease; line-height: 1.5;
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.alert-success { background: rgba(0,184,148,0.1); border: 1px solid rgba(0,184,148,0.25); color: var(--success); }
.alert-danger { background: rgba(231,76,60,0.1); border: 1px solid rgba(231,76,60,0.25); color: var(--danger); }

/* ===== MODAL ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); z-index: 1000;
    justify-content: center; align-items: center;
    backdrop-filter: blur(5px); padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card); border-radius: 20px; padding: 35px;
    max-width: 460px; width: 100%; border: 1px solid var(--border);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal .modal-icon { font-size: 48px; text-align: center; margin-bottom: 15px; }
.modal h3 { margin-bottom: 12px; text-align: center; font-size: 20px; }
.modal p { color: var(--text-secondary); margin-bottom: 25px; line-height: 1.6; text-align: center; font-size: 14px; }
.modal-actions { display: flex; justify-content: center; gap: 12px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 56px; margin-bottom: 15px; opacity: 0.6; }
.empty-state h3 { margin-bottom: 8px; color: var(--text-secondary); font-size: 18px; }
.empty-state p { color: var(--text-secondary); font-size: 13px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar { padding: 0 15px; height: 60px; }
    .main-content { padding: 0 15px; margin: 15px auto; }
    .form-row, .form-row.three-col { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .table-header { flex-direction: column; align-items: stretch; }
    .search-box input { width: 100%; }
    .search-box input:focus { width: 100%; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .login-card { padding: 35px 25px; }
    .form-card-body { padding: 20px; }
}