/* =====================================================
   Schengen Appointment System - Stylesheet
   ===================================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f5f6f8;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== Layout ========== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
}

.brand-logo {
    width: 40px; height: 40px;
    background: #2563eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.brand-name { color: white; font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 11px; color: #94a3b8; }

.nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.nav a {
    display: block;
    padding: 10px 20px;
    color: #cbd5e1;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav a:hover {
    background: #334155;
    color: white;
    text-decoration: none;
    border-left-color: #2563eb;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #334155;
}

.avatar {
    width: 36px; height: 36px;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-meta { flex: 1; min-width: 0; }
.user-name { color: white; font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: #94a3b8; }

.logout {
    color: #cbd5e1;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
}
.logout:hover { background: #334155; color: white; text-decoration: none; }

.main { flex: 1; padding: 24px 32px; overflow-y: auto; }

/* ========== Page Headers ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.page-header h1 { font-size: 22px; font-weight: 600; color: #111827; }
.page-header .subtitle { color: #6b7280; font-size: 13px; margin-top: 4px; }

/* ========== Cards ========== */
.card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.card-title { font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 14px; }

/* ========== Stat Cards ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}

.stat-label { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 600; color: #111827; }
.stat-meta { font-size: 12px; color: #6b7280; margin-top: 4px; }

.stat-card.info  { border-left: 4px solid #2563eb; }
.stat-card.green { border-left: 4px solid #16a34a; }
.stat-card.amber { border-left: 4px solid #d97706; }
.stat-card.red   { border-left: 4px solid #dc2626; }

/* ========== Tables ========== */
.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

table.data th {
    background: #f9fafb;
    text-align: left;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e5e7eb;
}

table.data td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #374151;
}

table.data tr:hover td { background: #fafbfc; }
table.data tr:last-child td { border-bottom: none; }

/* ========== Forms ========== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    color: #111827;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; color: white; }

.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; color: white; }

.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; color: white; }

.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; color: #111827; }

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

/* ========== Badges ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ========== Alerts ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ========== Applicant Cards (in new request form) ========== */
.applicant-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
    background: #fafbfc;
    position: relative;
}

.applicant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #d1d5db;
}

.applicant-title { font-weight: 600; color: #111827; }

.btn-remove {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 13px;
}

/* ========== Login Page ========== */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: 14px;
    padding: 36px 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.login-card h1 { font-size: 22px; margin-bottom: 4px; color: #111827; }
.login-card .sub { color: #6b7280; margin-bottom: 26px; font-size: 13px; }

.login-card .btn { width: 100%; padding: 11px; font-size: 14px; }

.login-hint {
    margin-top: 20px;
    padding: 12px 14px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 12px;
    color: #4b5563;
}
.login-hint strong { color: #111827; }

/* ========== Helpers ========== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: #6b7280; }
.text-right { text-align: right; }

/* Top bar shown on every authenticated page */
.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 16px;
    margin: -20px -20px 20px -20px;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
}
.topbar-greeting {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}
.topbar-greeting strong { color: #111827; }
.topbar-hi { color: #9ca3af; }
.topbar-role {
    background: #e6f1fb;
    color: #0c447c;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.topbar-logout {
    text-decoration: none !important;
}
