/* ════════════════════════════════════════════════════════════════════════
   CleanLemon - Admin Panel Styles
   Brand: Verde #5BAD27, Amarillo #FAD71B, Dorado #F5C501, Verde claro #9BCD52
   ════════════════════════════════════════════════════════════════════════ */

:root {
    --cl-green: #5BAD27;
    --cl-green-dark: #4A8E20;
    --cl-green-light: #9BCD52;
    --cl-yellow: #FAD71B;
    --cl-gold: #F5C501;
    --cl-bg: #f8f9fa;
    --cl-sidebar-width: 260px;
    --cl-sidebar-collapsed: 60px;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    background-color: var(--cl-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
}

/* ─── Navbar ─────────────────────────────────────────────────────────── */

.cl-navbar {
    background: linear-gradient(135deg, var(--cl-green) 0%, var(--cl-green-dark) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0 1rem;
    height: 56px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.cl-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
}

.cl-navbar .navbar-brand img {
    height: 36px;
}

.cl-navbar .navbar-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
}

.cl-navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cl-navbar-right a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.875rem;
}

.cl-navbar-right a:hover {
    color: white;
}

.cl-sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */

.cl-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: var(--cl-sidebar-width);
    background: white;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease;
    z-index: 1020;
    padding-top: 0.5rem;
}

.cl-sidebar-section {
    padding: 0.25rem 0;
}

.cl-sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    padding: 0.75rem 1.25rem 0.25rem;
    font-weight: 600;
}

.cl-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    color: #555;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.cl-sidebar a:hover {
    background: #f0f7e8;
    color: var(--cl-green);
}

.cl-sidebar a.active {
    background: #eef6e4;
    color: var(--cl-green);
    border-left-color: var(--cl-green);
    font-weight: 600;
}

.cl-sidebar a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* ─── Main Content ───────────────────────────────────────────────────── */

.cl-main {
    margin-left: var(--cl-sidebar-width);
    margin-top: 56px;
    padding: 1.5rem;
    min-height: calc(100vh - 56px);
    transition: margin-left 0.2s ease;
}

/* ─── Page Header ────────────────────────────────────────────────────── */

.cl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--cl-green-light);
}

.cl-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* ─── Cards ──────────────────────────────────────────────────────────── */

.cl-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.cl-card-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cl-card-body {
    padding: 1.25rem;
}

/* ─── KPI Cards ──────────────────────────────────────────────────────── */

.cl-kpi-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cl-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cl-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.cl-kpi-icon.green { background: linear-gradient(135deg, var(--cl-green), var(--cl-green-light)); }
.cl-kpi-icon.yellow { background: linear-gradient(135deg, var(--cl-gold), var(--cl-yellow)); }
.cl-kpi-icon.blue { background: linear-gradient(135deg, #4A90D9, #6BB3F0); }
.cl-kpi-icon.purple { background: linear-gradient(135deg, #7B5EA7, #A78BDB); }

.cl-kpi-content {
    flex: 1;
}

.cl-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.cl-kpi-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

/* ─── Tables / Grid ──────────────────────────────────────────────────── */

.cl-grid {
    width: 100%;
    border-collapse: collapse;
}

.cl-grid thead th {
    background: #fafafa;
    border-bottom: 2px solid #e8e8e8;
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
    white-space: nowrap;
}

.cl-grid thead th a {
    color: #666;
    text-decoration: none;
}

.cl-grid thead th a:hover {
    color: var(--cl-green);
}

.cl-grid tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
    color: #444;
    vertical-align: middle;
}

.cl-grid tbody tr:hover {
    background: #fafff5;
}

.cl-grid tbody tr:last-child td {
    border-bottom: none;
}

.cl-grid a.cl-grid-link {
    color: var(--cl-green);
    font-weight: 600;
    text-decoration: none;
}

.cl-grid a.cl-grid-link:hover {
    color: var(--cl-green-dark);
    text-decoration: underline;
}

/* ─── Forms ──────────────────────────────────────────────────────────── */

.cl-fieldset {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    margin-bottom: 1.5rem;
    padding: 0;
    overflow: hidden;
}

.cl-fieldset-legend {
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
    margin: 0;
}

.cl-fieldset-body {
    padding: 1.25rem;
}

.cl-form-group {
    margin-bottom: 1rem;
}

.cl-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cl-form-group .form-control,
.cl-form-group .form-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cl-form-group .form-control:focus,
.cl-form-group .form-select:focus {
    border-color: var(--cl-green);
    box-shadow: 0 0 0 0.2rem rgba(91, 173, 39, 0.15);
}

.cl-form-group .form-check-input:checked {
    background-color: var(--cl-green);
    border-color: var(--cl-green);
}

.cl-form-group textarea.form-control {
    min-height: 100px;
}

/* ─── Toolbar ────────────────────────────────────────────────────────── */

.cl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.cl-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cl-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cl-total-label {
    font-size: 0.8rem;
    color: #888;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */

.btn-cl-primary {
    background: linear-gradient(135deg, var(--cl-green), var(--cl-green-dark));
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-cl-primary:hover {
    background: linear-gradient(135deg, var(--cl-green-dark), #3d7518);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(91, 173, 39, 0.3);
}

.btn-cl-secondary {
    background: white;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-cl-secondary:hover {
    background: #f8f8f8;
    color: #333;
    border-color: #ccc;
    text-decoration: none;
}

.btn-cl-danger {
    background: white;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-cl-danger:hover {
    background: #dc3545;
    color: white;
}

.btn-cl-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-cl-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
}

/* ─── Badges ─────────────────────────────────────────────────────────── */

.cl-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.cl-badge-success {
    background: #e8f5e0;
    color: var(--cl-green-dark);
}

.cl-badge-warning {
    background: #fff8e1;
    color: #b8860b;
}

.cl-badge-danger {
    background: #fde8e8;
    color: #c0392b;
}

.cl-badge-info {
    background: #e8f0fe;
    color: #2962ff;
}

/* ─── Pager ──────────────────────────────────────────────────────────── */

.cl-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 0;
}

.cl-pager a,
.cl-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.cl-pager a {
    color: #555;
    border: 1px solid #ddd;
}

.cl-pager a:hover {
    background: var(--cl-green);
    color: white;
    border-color: var(--cl-green);
}

.cl-pager span.active {
    background: var(--cl-green);
    color: white;
    border: 1px solid var(--cl-green);
    font-weight: 700;
}

/* ─── Alerts ─────────────────────────────────────────────────────────── */

.cl-alert-success {
    background: #e8f5e0;
    border: 1px solid #c3e6a8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    color: var(--cl-green-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cl-alert-success i {
    font-size: 1.25rem;
}

/* ─── Validation ─────────────────────────────────────────────────────── */

.field-validation-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.input-validation-error {
    border-color: #dc3545 !important;
}

.validation-summary-errors {
    background: #fde8e8;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #721c24;
    font-size: 0.875rem;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 991px) {
    .cl-sidebar {
        width: var(--cl-sidebar-collapsed);
    }

    .cl-sidebar .cl-sidebar-section-title,
    .cl-sidebar a span {
        display: none;
    }

    .cl-sidebar a {
        justify-content: center;
        padding: 0.65rem 0;
    }

    .cl-sidebar a i {
        margin: 0;
    }

    .cl-main {
        margin-left: var(--cl-sidebar-collapsed);
    }
}

@media (max-width: 767px) {
    .cl-sidebar {
        display: none;
    }

    .cl-main {
        margin-left: 0;
        padding: 1rem;
    }

    .cl-sidebar.show {
        display: block;
        width: var(--cl-sidebar-width);
    }
}

/* ─── Utilities ──────────────────────────────────────────────────────── */

.text-cl-green { color: var(--cl-green); }
.text-cl-gold { color: var(--cl-gold); }
.bg-cl-green { background-color: var(--cl-green); color: white; }
.bg-cl-gold { background-color: var(--cl-gold); color: #333; }

/* ─── Login ─────────────────────────────────────────────────────────── */

.login-standalone-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.login-form-inner {
    max-width: 380px;
    margin: 0 auto;
    padding: 1.5rem 0.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.login-logo img {
    height: 72px;
}

.login-title {
    text-align: center;
    font-weight: 700;
    color: var(--cl-green-dark);
    margin-bottom: 1.5rem;
}

.login-btn {
    background-color: var(--cl-green);
    border-color: var(--cl-green);
    font-weight: 600;
    padding: 0.6rem;
    margin-top: 0.5rem;
}

.login-btn:hover {
    background-color: var(--cl-green-dark);
    border-color: var(--cl-green-dark);
}

/* ─── Navbar logout ─────────────────────────────────────────────────── */

.cl-navbar-logout {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.cl-navbar-logout:hover {
    color: white;
}
