/* ============================================
   VOSEN Certificate Training - Main Stylesheet
   ============================================ */

:root {
    --primary: #1a3c5e;
    --primary-light: #2a5a8a;
    --gold: #c9a84c;
    --gold-light: #e0c56e;
    --bg: #f4f6f9;
    --sidebar-bg: #0f1f33;
    --sidebar-hover: #1a3050;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #e0e4ea;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --transition: all 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1f33 0%, #1a3c5e 50%, #1a3c5e 100%);
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 48px;
    color: var(--gold);
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,60,94,0.1);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

/* ========== APP LAYOUT ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-icon {
    font-size: 32px;
    color: var(--gold);
}

.brand-text h2 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
}

.brand-text span {
    font-size: 11px;
    color: var(--gold-light);
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-section {
    padding: 8px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--gold);
}

.nav-item.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--gold);
    font-weight: 600;
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.nav-separator {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 8px 16px;
}

.nav-logout { color: rgba(255,255,255,0.5); }
.nav-logout:hover { color: #ff6b6b; border-left-color: #ff6b6b; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--gold);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info-mini small {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px 35px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.page-header p {
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== CARDS ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* ========== STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon { font-size: 36px; }
.stat-value { font-size: 28px; font-weight: 700; display: block; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-muted); }

.stat-blue { border-left-color: var(--info); }
.stat-green { border-left-color: var(--success); }
.stat-purple { border-left-color: #8e44ad; }
.stat-orange { border-left-color: var(--warning); }
.stat-cyan { border-left-color: #1abc9c; }
.stat-pink { border-left-color: #e91e63; }

/* ========== FORMS ========== */
.styled-form .form-group {
    margin-bottom: 16px;
}

.styled-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--text);
}

.styled-form input[type="text"],
.styled-form input[type="password"],
.styled-form input[type="date"],
.styled-form input[type="number"],
.styled-form input[type="file"],
.styled-form select,
.styled-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: #fafbfc;
}

.styled-form input:focus,
.styled-form select:focus,
.styled-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,60,94,0.08);
    background: #fff;
}

.styled-form textarea { resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    text-align: center;
    margin-top: 24px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }

.btn-secondary {
    background: #e8ecf1;
    color: var(--text);
}
.btn-secondary:hover { background: #d5dbe3; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

.btn-edit { background: #e8f4fd; color: var(--info); }
.btn-edit:hover { background: #d0e8f8; }

.btn-delete { background: #fdeaea; color: var(--danger); }
.btn-delete:hover { background: #f8d0d0; }

/* ========== TABLES ========== */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tbody tr:hover { background: #fafbfc; }

.table-logo { height: 40px; border-radius: 4px; object-fit: contain; }
.table-ttd { height: 35px; background: #f5f5f5; padding: 3px; border-radius: 4px; }
.no-logo { color: var(--text-muted); font-style: italic; }

.actions { white-space: nowrap; }
.text-center { text-align: center; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e8f4fd;
    color: var(--info);
}

.badge-blue { background: #e8f4fd; color: var(--info); }

/* ========== ALERTS ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
}

.alert-success { background: #eafaf1; color: #1e7e34; border-left: 4px solid var(--success); }
.alert-error { background: #fdeaea; color: #c0392b; border-left: 4px solid var(--danger); }

/* ========== CONTENT GRID ========== */
.content-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

.form-card { position: sticky; top: 20px; }

/* ========== PESERTA CONTAINER ========== */
.peserta-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.peserta-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    background: #f8f9fb;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.peserta-number {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.flex-1 { flex: 1; }

/* ========== QUICK ACTIONS ========== */
.quick-actions { margin-top: 10px; }
.quick-actions h2 { font-size: 18px; margin-bottom: 16px; color: var(--primary); }

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.action-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--primary);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.action-card:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.action-icon { font-size: 24px; }

/* ========== CURRENT IMAGE ========== */
.current-image {
    margin-bottom: 8px;
    padding: 8px;
    background: #f8f9fb;
    border-radius: 6px;
    display: inline-block;
}

.current-image img { display: block; }
.current-image small { display: block; color: var(--text-muted); margin-top: 4px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; padding: 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header h1 { font-size: 20px; }
}

@media (max-width: 600px) {
    .sidebar { width: 60px; }
    .sidebar .brand-text,
    .sidebar .nav-item span:not(.nav-icon),
    .sidebar .nav-section,
    .sidebar .user-info-mini div,
    .sidebar-footer { display: none; }
    .sidebar-brand { padding: 16px 10px; justify-content: center; }
    .nav-item { padding: 12px; justify-content: center; }
    .main-content { margin-left: 60px; padding: 15px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ========== SERTIFIKAT FORM ========== */
.sertifikat-form .card { margin-bottom: 20px; }

/* ========== MODERN FORM ========== */
.modern-card {
    border: 1px solid #e0e4ea;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.card-header-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-icon {
    font-size: 28px;
    background: #f4f6f9;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.modern-input label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: #444;
    display: block;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}

.modern-select,
.modern-date,
.modern-number,
.peserta-row input {
    width: 100%;
    padding: 12px 12px 12px 45px; /* ruang untuk icon */
    border: 2px solid #e0e4ea;
    border-radius: 12px;
    font-size: 14px;
    background: #fafbfc;
    transition: all 0.2s;
    font-family: inherit;
    appearance: none; /* hapus default arrow di select */
    -webkit-appearance: none;
}

.modern-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 35px;
}

.modern-select:focus,
.modern-date:focus,
.modern-number:focus,
.peserta-row input:focus {
    border-color: #1a3c5e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.1);
    outline: none;
}

/* Preview tanggal */
.date-preview {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #777;
}
.date-preview em {
    font-weight: 600;
    color: #1a3c5e;
}

/* Peserta row styling */
.peserta-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 15px;
}

.peserta-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 18px;
    background: #f8fafd;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
}

.peserta-row:hover {
    background: #fff;
    border-color: #1a3c5e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.peserta-number {
    width: 40px;
    height: 40px;
    background: #1a3c5e;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(26, 60, 94, 0.3);
}

.peserta-row input {
    padding-left: 15px; /* tanpa icon di sini */
}

/* Tombol generate */
.btn-generate {
    background: linear-gradient(135deg, #1a3c5e, #2e7d32);
    border: none;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(26, 60, 94, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(26, 60, 94, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .input-with-icon {
        flex-direction: column;
        align-items: stretch;
    }
    .input-icon {
        position: static;
        margin-bottom: 5px;
    }
    .modern-select,
    .modern-date,
    .modern-number {
        padding-left: 12px;
    }
}