:root {
    --brand-navy: #1e293b;
    --brand-blue: #2563eb;
    --brand-blue-dark: #1d4ed8;
    --bg-soft: #f4f6fb;
    --shadow: 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);
    --radius: 14px;
}

body {
    background-color: var(--bg-soft);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1e293b;
}

.btn { border-radius: 8px; }
.btn-primary { background-color: var(--brand-blue); border-color: var(--brand-blue); }
.btn-primary:hover { background-color: var(--brand-blue-dark); border-color: var(--brand-blue-dark); transform: translateY(-1px); }

/* Back link, used on nuevo.php / editar.php */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    font-size: .92rem;
    margin-bottom: 14px;
    transition: color .15s;
}
.back-link:hover { color: var(--brand-blue); }

/* Login page */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.card-login {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}
.card-login .card-header {
    background: white;
    border-bottom: none;
    padding-top: 40px;
    text-align: center;
}

/* Form pages (nuevo.php, editar.php) */
.form-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
}
.form-shell { width: 100%; max-width: 620px; }
.card-form {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
}
.card-form .card-header {
    background-color: #ffffff;
    border-bottom: 2px solid #f0f0f0;
    padding: 25px;
    text-align: center;
}
.logo-header { max-height: 56px; margin-bottom: 10px; }
.form-label { font-weight: 500; color: #495057; font-size: .9em; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .18);
}
.section-title {
    font-size: .78em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin: 10px 0 15px;
    font-weight: 700;
}

@media (max-width: 576px) {
    .card-form .card-header { padding: 20px 16px; }
    .card-form .card-body { padding: 20px 16px !important; }
}

/* Admin panel */
.panel-wrap { padding: 20px; }
@media (min-width: 992px) { .panel-wrap { padding: 32px; } }

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand .logo-header { max-height: 44px; margin-bottom: 0; }
.topbar-title { font-weight: 600; color: var(--brand-navy); font-size: 1.15rem; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-box { max-width: 180px; }

.card { border-radius: var(--radius); border: none; box-shadow: var(--shadow); }
.table thead th { background-color: var(--brand-navy); color: #fff; font-weight: 500; border: none; white-space: nowrap; }
.table-hover tbody tr:hover { background-color: #eef2fb; }
.badge-status { font-size: .8em; padding: 5px 12px; border-radius: 20px; }
.btn-action { margin-right: 2px; }
.days-remaining { font-weight: bold; }
.days-warning { color: #d97706; }
.days-danger { color: #dc2626; }
.days-ok { color: #16a34a; }

@media (max-width: 576px) {
    .panel-wrap { padding: 12px; }
    .topbar-actions .btn, .topbar-actions .filter-box { font-size: .82rem; }
    .btn-action { padding: 4px 7px; font-size: .78rem; }
    .card.p-3 { padding: 12px !important; }
}
