/* ============================================================
   SKKK LMS — App-wide styles  (sidebar handled by sidebar-modern.css)
   ============================================================ */

:root {
    --primary-color:   #0d6efd;
    --success-color:   #198754;
    --danger-color:    #dc3545;
    --warning-color:   #ffc107;
    --info-color:      #0dcaf0;
    --transition:      all .2s ease;
    --card-radius:     .75rem;
    --card-shadow:     0 2px 12px rgba(0,0,0,.07);
    --card-shadow-hover: 0 6px 20px rgba(0,0,0,.11);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f1f5f9;
}

/* ============================================================
   PAGE CONTENT (inside .main-content, below topbar)
   ============================================================ */
.page-content {
    padding: 1.75rem 2rem;
    flex: 1;
}

@media (max-width: 768px) { .page-content { padding: 1rem 1rem; } }
@media (max-width: 576px) { .page-content { padding: .75rem .75rem; } }

/* ── Page header block ── */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 .25rem;
}

.page-subtitle {
    font-size: .85rem;
    color: #64748b;
    margin: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    background: #fff;
}

.card:hover { box-shadow: var(--card-shadow-hover); }

.card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.card-body { padding: 1.25rem; }

/* ── Centered form card (create / edit pages) ── */
.form-card-wrap {
    max-width: 720px;
    margin-inline: auto;
}

.form-card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background: #fff;
}

.form-card .card-header {
    background: linear-gradient(90deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e8edf4;
    padding: 1.125rem 1.5rem;
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}

.form-card .card-body { padding: 1.75rem 1.5rem; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 1.375rem 1.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.stat-card.blue   { border-left-color: #3b82f6; }
.stat-card.green  { border-left-color: #22c55e; }
.stat-card.orange { border-left-color: #f59e0b; }
.stat-card.red    { border-left-color: #ef4444; }

.stat-card-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.stat-card-label {
    font-size: .82rem;
    color: #64748b;
    margin-top: .375rem;
}

.stat-card-icon {
    font-size: 2.25rem;
    opacity: .09;
    text-align: right;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: .45rem;
    font-weight: 500;
    transition: var(--transition);
    padding: .5rem 1.125rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13,110,253,.3);
}

.btn-sm { padding: .35rem .75rem; font-size: .825rem; }

/* ============================================================
   TABLES
   ============================================================ */
.table-card { border-radius: var(--card-radius); overflow: hidden; box-shadow: var(--card-shadow); }

.table {
    background: #fff;
    margin-bottom: 0;
    font-size: .875rem;
}

.table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e8edf4;
}

.table thead th {
    font-weight: 600;
    color: #374151;
    padding: .875rem 1rem;
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
    color: #374151;
    border-color: #f1f5f9;
}

.table tbody tr:hover { background: #fafbff; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control,
.form-select {
    border: 1px solid #e2e8f0;
    border-radius: .45rem;
    padding: .55rem .875rem;
    font-size: .875rem;
    transition: var(--transition);
    background: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
    outline: none;
}

.form-label {
    font-weight: 500;
    font-size: .85rem;
    color: #374151;
    margin-bottom: .375rem;
}

.input-group .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    border-radius: .45rem 0 0 .45rem;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border: none;
    border-radius: .6rem;
    border-left: 4px solid;
    font-size: .875rem;
    padding: .875rem 1.125rem;
}

.alert-success  { border-left-color: #22c55e; background: #f0fdf4; color: #166534; }
.alert-danger   { border-left-color: #ef4444; background: #fef2f2; color: #991b1b; }
.alert-warning  { border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.alert-info     { border-left-color: #3b82f6; background: #eff6ff; color: #1e40af; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    padding: .3rem .65rem;
    font-weight: 500;
    border-radius: 2rem;
    font-size: .73rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin: 0;
    flex-wrap: wrap;
}

.pagination .page-item .page-link {
    border: 1px solid #e2e8f0;
    border-radius: .5rem !important;
    color: #374151;
    background: #fff;
    font-size: .825rem;
    font-weight: 500;
    padding: .45rem .85rem;
    line-height: 1.4;
    transition: var(--transition);
    min-width: 36px;
    text-align: center;
}

.pagination .page-item .page-link:hover {
    background: #f0f4ff;
    border-color: #667eea;
    color: #667eea;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(102,126,234,.35);
}

.pagination .page-item.disabled .page-link {
    background: #f8fafc;
    border-color: #e8edf4;
    color: #b0bec5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .875rem 1rem;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.pagination-info {
    font-size: .8rem;
    color: #94a3b8;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.modal-header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.modal-body  { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #f1f5f9; }

/* ============================================================
   UTILITY
   ============================================================ */
.text-muted { color: #64748b !important; }
.fs-xs      { font-size: .78rem; }
.fs-sm      { font-size: .85rem; }
.rounded-pill-sm { border-radius: .5rem; }
