/* =============================================
   Chato Certificates – Global Theme
   Modern blue, rounded, card-based design
   ============================================= */

/* ---------- Base ---------- */
:root {
    --primary: #198754;
    --primary-dark: #0f5132;
    --primary-gradient: linear-gradient(135deg, #198754 0%, #157347 50%, #0f5132 100%);
    --bg: #f0f2f5;
    --card-radius: 16px;
    --input-radius: 12px;
    --btn-radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Navbar ---------- */
.navbar-chato {
    background: var(--primary-gradient) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
}
.navbar-chato .navbar-brand,
.navbar-chato .nav-link {
    color: #fff !important;
    font-weight: 500;
    transition: opacity 0.2s;
}
.navbar-chato .navbar-brand:hover,
.navbar-chato .nav-link:hover {
    opacity: 0.85;
}
.navbar-chato .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
}
.navbar-chato .navbar-toggler-icon {
    filter: invert(1);
}
.navbar-chato .dropdown-menu {
    border: none;
    border-radius: var(--input-radius);
    box-shadow: var(--shadow);
}

/* ---------- Content wrapper ---------- */
.content-wrapper {
    flex: 1;
    padding: 28px 0;
}

/* ---------- Cards ---------- */
.card-chato {
    background: #fff;
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.card-chato .card-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.card-chato .card-subtitle {
    font-size: 14px;
    color: #777;
    margin-bottom: 20px;
}

/* ---------- Form controls ---------- */
.form-control,
.form-select {
    border-radius: var(--input-radius);
    padding: 10px 16px;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
}
textarea.form-control {
    border-radius: var(--input-radius);
}
.form-label {
    font-weight: 500;
    font-size: 14px;
    color: #555;
    margin-bottom: 4px;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--btn-radius);
    font-weight: 500;
    padding: 8px 20px;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-outline-primary:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.btn-dark-login {
    background: #222;
    color: #fff;
    border: none;
}
.btn-dark-login:hover {
    background: var(--primary);
    color: #fff;
}

/* ---------- Tables ---------- */
.table-chato {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-chato thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border: none;
}
.table-chato thead th:first-child {
    border-radius: 12px 0 0 0;
}
.table-chato thead th:last-child {
    border-radius: 0 12px 0 0;
}
.table-chato tbody td {
    padding: 11px 14px;
    font-size: 14px;
    color: #444;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.table-chato tbody tr:hover {
    background: #f8f9ff;
}
.table-chato tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}
.table-chato tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--input-radius);
    font-size: 14px;
    border: none;
}

/* ---------- Pagination ---------- */
.pagination .page-link {
    border-radius: var(--btn-radius) !important;
    margin: 0 3px;
    border: none;
    color: var(--primary);
    font-size: 14px;
}
.pagination .page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff;
}
.pagination .page-link:hover {
    background: #d1f5e0;
}

/* ---------- Modals ---------- */
.modal-content {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid #eee;
    padding: 20px 24px;
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    border-top: 1px solid #eee;
    padding: 16px 24px;
}

/* ---------- Footer ---------- */
.footer-chato {
    background: var(--primary-gradient);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 16px 0;
    font-size: 13px;
    margin-top: auto;
}
.footer-chato a {
    color: #fff;
    text-decoration: underline;
}

/* ---------- Badge pills ---------- */
.badge-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-admin {
    background: #dc3545;
    color: #fff;
}
.badge-user {
    background: #198754;
    color: #fff;
}

/* ---------- Page header ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* ---------- Search bar ---------- */
.search-bar {
    display: flex;
    gap: 8px;
    max-width: 400px;
    width: 100%;
}
.search-bar .form-control {
    flex: 1;
}

/* ---------- Stat cards ---------- */
.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}
.stat-card .stat-label {
    font-size: 13px;
    color: #777;
    margin-top: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .card-chato {
        padding: 20px 18px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-bar {
        max-width: 100%;
    }
}
