/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #eef2f7;
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: #5b9bd5; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ===== LOGIN ===== */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(135deg, #d4e4f7, #b8d4f0);
}
.login-card {
    background: #fff; border-radius: 12px; padding: 40px;
    width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(91,155,213,.25);
}
.login-card h1 { text-align: center; color: #5b9bd5; font-size: 1.6rem; }
.login-subtitle { text-align: center; color: #888; margin-bottom: 24px; }

/* ===== NAVBAR ===== */
.navbar {
    background: #5b9bd5; color: #fff; position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 6px rgba(91,155,213,.3);
}
.nav-inner {
    max-width: 1400px; margin: 0 auto; display: flex;
    align-items: center; justify-content: space-between; padding: 0 20px;
    flex-wrap: wrap;
}
.nav-brand {
    font-weight: 700; font-size: 1.15rem; color: #fff !important;
    padding: 14px 0; text-decoration: none !important;
}
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
    color: #e6f0fa; padding: 14px 10px; font-size: .85rem;
    transition: color .2s, background .2s; white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.15); text-decoration: none; }
.nav-user { color: #d4e4f7; font-size: .8rem; margin-left: 8px; }
.nav-logout { color: #fff !important; font-weight: 600; }

/* ===== CONTAINER ===== */
.container { max-width: 1400px; margin: 0 auto; padding: 24px 20px; flex: 1; width: 100%; }

/* ===== CARDS ===== */
.card {
    background: #fff; border-radius: 10px; padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04); margin-bottom: 20px;
    border: 1px solid #e8ecf1;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #eef2f7;
}
.card-header h2 { font-size: 1.2rem; color: #5b9bd5; }
.card-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: #fff; border-radius: 10px; padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04); text-align: center;
    border: 1px solid #e8ecf1;
}
.stat-card .number { font-size: 2rem; font-weight: 700; color: #5b9bd5; }
.stat-card .label { font-size: .85rem; color: #888; margin-top: 4px; }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%; border-collapse: collapse; font-size: .9rem;
}
th, td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef2f7;
}
th { background: #f4f7fb; font-weight: 600; color: #5b9bd5; font-size: .8rem; text-transform: uppercase; }
tr:hover { background: #f0f7ff; }
.table-actions { display: flex; gap: 6px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; color: #555; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid #dce1e8; border-radius: 6px;
    font-size: .9rem; transition: border-color .2s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #5b9bd5; box-shadow: 0 0 0 3px rgba(91,155,213,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px;
    border: none; border-radius: 6px; font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: all .2s; text-decoration: none !important;
}
.btn-primary { background: #5b9bd5; color: #fff; }
.btn-primary:hover { background: #4a8ac7; }
.btn-success { background: #06d6a0; color: #fff; }
.btn-success:hover { background: #05c494; }
.btn-danger { background: #ef476f; color: #fff; }
.btn-danger:hover { background: #d63d61; }
.btn-warning { background: #ffd166; color: #333; }
.btn-warning:hover { background: #e6bc5c; }
.btn-secondary { background: #a0aab8; color: #fff; }
.btn-secondary:hover { background: #8e98a5; }
.btn-info { background: #5b9bd5; color: #fff; }
.btn-info:hover { background: #4a8ac7; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px; border-radius: 6px; margin-bottom: 16px;
    font-size: .9rem; border: 1px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* ===== BADGES ===== */
.badge {
    display: inline-block; padding: 3px 8px; border-radius: 20px;
    font-size: .75rem; font-weight: 600;
}
.badge-success { background: #06d6a0; color: #fff; }
.badge-warning { background: #ffd166; color: #333; }
.badge-danger { background: #ef476f; color: #fff; }
.badge-info { background: #5b9bd5; color: #fff; }
.badge-secondary { background: #a0aab8; color: #fff; }

/* ===== SEARCH & FILTERS ===== */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input, .search-bar select {
    padding: 8px 12px; border: 1.5px solid #dce1e8; border-radius: 6px; font-size: .85rem;
}
.search-bar input[type="text"] { flex: 1; min-width: 200px; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span {
    padding: 6px 12px; border-radius: 4px; font-size: .85rem;
}
.pagination a { background: #fff; border: 1px solid #dce1e8; color: #5b9bd5; }
.pagination a:hover { background: #f0f7ff; text-decoration: none; }
.pagination .active { background: #5b9bd5; color: #fff; border-color: #5b9bd5; }

/* ===== MODAL ===== */
.modal { display: none; position: fixed; z-index: 999; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,.5);
    align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal-content { background: #fff; border-radius: 12px; padding: 28px;
    max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
}

/* ===== FOOTER ===== */
.footer { text-align: center; padding: 16px; color: #a0aab8; font-size: .8rem;
    border-top: 1px solid #e8ecf1; margin-top: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .nav-links { gap: 0; }
    .nav-links a { padding: 10px 8px; font-size: .8rem; }
    .stat-card .number { font-size: 1.5rem; }
}
