/*
 * Admin Panel Styles
 * AMB Peru - CodeIgniter 4
 */

/* ============================================
   LAYOUT - Sidebar and Content
   ============================================ */

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 256px;
    background-color: #333;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background-color: #222;
    text-align: center;
    border-bottom: 1px solid #444;
}

.sidebar-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.8rem;
}

.sidebar-header .user-info {
    color: #aaa;
    font-size: 1.2rem;
    margin-top: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 15px 20px;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid #444;
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: #1EAEDB;
    color: #fff;
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: 256px;
    padding: 20px 30px;
    min-height: 100vh;
    background-color: #f5f5f5;
    width: calc(100% - 256px);
}

.main-content.full-width {
    margin-left: 0;
    width: 100%;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
    background-color: #fafafa;
}

.card-header h4,
.card-header h5 {
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid #e1e1e1;
    background-color: #fafafa;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: middle;
}

.table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-striped tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    height: auto;
    line-height: 1;
    display: inline-block;
    padding: 8px 16px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 5px;
    margin-bottom: 5px;
    text-transform: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 1.1rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.5rem;
}

.btn-primary {
    background-color: #33C3F0;
    border-color: #33C3F0;
    color: #fff;
}

.btn-primary:hover {
    background-color: #1EAEDB;
    border-color: #1EAEDB;
    color: #fff;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #fff;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #fff;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: #fff;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger,
.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    font-size: 1.4rem;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #33C3F0;
    outline: none;
}

textarea.form-control {
    height: auto;
    min-height: 100px;
}

select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 8px 10px;
    padding-right: 30px;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-right: 8px;
}

.form-text {
    font-size: 1.2rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 1.2rem;
    margin-top: 0.25rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #28a745;
    color: #fff;
}

.badge-danger {
    background-color: #dc3545;
    color: #fff;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
    color: #fff;
}

.badge-primary {
    background-color: #33C3F0;
    color: #fff;
}

.badge-secondary {
    background-color: #6c757d;
    color: #fff;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.pagination li {
    margin: 0 2px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination li a:hover {
    background-color: #f5f5f5;
}

.pagination li.active span {
    background-color: #33C3F0;
    border-color: #33C3F0;
    color: #fff;
}

.pagination li.disabled span {
    color: #999;
    cursor: not-allowed;
}

/* ============================================
   SPACING UTILITIES - Compatible with Skeleton
   ============================================ */

/* Margin - All sides */
.m-0 { margin: 0 !important; }
.m-1 { margin: 1rem !important; }
.m-2 { margin: 2rem !important; }
.m-3 { margin: 3rem !important; }
.m-4 { margin: 4rem !important; }
.m-5 { margin: 5rem !important; }
.m-auto { margin: auto !important; }

/* Margin Top */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 1rem !important; }
.mt-2 { margin-top: 2rem !important; }
.mt-3 { margin-top: 3rem !important; }
.mt-4 { margin-top: 4rem !important; }
.mt-5 { margin-top: 5rem !important; }

/* Margin Bottom */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 1rem !important; }
.mb-2 { margin-bottom: 2rem !important; }
.mb-3 { margin-bottom: 3rem !important; }
.mb-4 { margin-bottom: 4rem !important; }
.mb-5 { margin-bottom: 5rem !important; }

/* Margin Left */
.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 1rem !important; }
.ml-2 { margin-left: 2rem !important; }
.ml-3 { margin-left: 3rem !important; }
.ml-4 { margin-left: 4rem !important; }
.ml-5 { margin-left: 5rem !important; }
.ml-auto { margin-left: auto !important; }

/* Margin Right */
.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 1rem !important; }
.mr-2 { margin-right: 2rem !important; }
.mr-3 { margin-right: 3rem !important; }
.mr-4 { margin-right: 4rem !important; }
.mr-5 { margin-right: 5rem !important; }
.mr-auto { margin-right: auto !important; }

/* Margin X-axis (left + right) */
.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-2 { margin-left: 2rem !important; margin-right: 2rem !important; }
.mx-3 { margin-left: 3rem !important; margin-right: 3rem !important; }
.mx-4 { margin-left: 4rem !important; margin-right: 4rem !important; }
.mx-5 { margin-left: 5rem !important; margin-right: 5rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* Margin Y-axis (top + bottom) */
.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-2 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
.my-3 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
.my-4 { margin-top: 4rem !important; margin-bottom: 4rem !important; }
.my-5 { margin-top: 5rem !important; margin-bottom: 5rem !important; }

/* Padding - All sides */
.p-0 { padding: 0 !important; }
.p-1 { padding: 1rem !important; }
.p-2 { padding: 2rem !important; }
.p-3 { padding: 3rem !important; }
.p-4 { padding: 4rem !important; }
.p-5 { padding: 5rem !important; }

/* Padding Top */
.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 1rem !important; }
.pt-2 { padding-top: 2rem !important; }
.pt-3 { padding-top: 3rem !important; }
.pt-4 { padding-top: 4rem !important; }
.pt-5 { padding-top: 5rem !important; }

/* Padding Bottom */
.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 1rem !important; }
.pb-2 { padding-bottom: 2rem !important; }
.pb-3 { padding-bottom: 3rem !important; }
.pb-4 { padding-bottom: 4rem !important; }
.pb-5 { padding-bottom: 5rem !important; }

/* Padding Left */
.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 1rem !important; }
.pl-2 { padding-left: 2rem !important; }
.pl-3 { padding-left: 3rem !important; }
.pl-4 { padding-left: 4rem !important; }
.pl-5 { padding-left: 5rem !important; }

/* Padding Right */
.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 1rem !important; }
.pr-2 { padding-right: 2rem !important; }
.pr-3 { padding-right: 3rem !important; }
.pr-4 { padding-right: 4rem !important; }
.pr-5 { padding-right: 5rem !important; }

/* Padding X-axis (left + right) */
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-2 { padding-left: 2rem !important; padding-right: 2rem !important; }
.px-3 { padding-left: 3rem !important; padding-right: 3rem !important; }
.px-4 { padding-left: 4rem !important; padding-right: 4rem !important; }
.px-5 { padding-left: 5rem !important; padding-right: 5rem !important; }

/* Padding Y-axis (top + bottom) */
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-2 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.py-3 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.py-4 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
.py-5 { padding-top: 5rem !important; padding-bottom: 5rem !important; }

/* Gap utilities for flexbox */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: 1rem !important; }
.gap-2 { gap: 2rem !important; }
.gap-3 { gap: 3rem !important; }
.gap-4 { gap: 4rem !important; }
.gap-5 { gap: 5rem !important; }

/* ============================================
   TEXT UTILITIES
   ============================================ */

/* Text Alignment */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-justify { text-align: justify !important; }

/* Text Colors */
.text-primary { color: #33C3F0 !important; }
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-warning { color: #856404 !important; }
.text-info { color: #17a2b8 !important; }
.text-muted { color: #6c757d !important; }
.text-white { color: #fff !important; }
.text-dark { color: #333 !important; }

/* Text Transform */
.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }

/* Font Weight */
.font-weight-light { font-weight: 300 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-semibold { font-weight: 600 !important; }
.font-weight-bold { font-weight: 700 !important; }

/* ============================================
   DISPLAY UTILITIES
   ============================================ */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flexbox Utilities */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

/* ============================================
   WIDTH & HEIGHT UTILITIES
   ============================================ */

.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

/* ============================================
   IMAGE UTILITIES
   ============================================ */

.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    max-width: 100px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e1e1;
}

.page-header h2 {
    margin: 0;
    font-size: 2.4rem;
}

/* ============================================
   DASHBOARD STATS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.stat-card .stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    color: #666;
    font-size: 1.4rem;
}

.stat-card.primary { border-left: 4px solid #33C3F0; }
.stat-card.success { border-left: 4px solid #28a745; }
.stat-card.warning { border-left: 4px solid #ffc107; }
.stat-card.danger { border-left: 4px solid #dc3545; }

/* ============================================
   ACTION BUTTONS GROUP
   ============================================ */

.actions {
    white-space: nowrap;
}

.actions .btn {
    margin-bottom: 0;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #33C3F0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   SEARCH BOX
   ============================================ */

.search-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    margin-bottom: 20px;
    display: block;
    max-width: none;
    width: 100%;
}

.search-form {
    margin: 0;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    overflow: hidden;
    border: 1px solid #d1d1d1;
}

.search-input-wrapper:focus-within {
    border-color: #33C3F0;
    box-shadow: 0 2px 12px rgba(51, 195, 240, 0.15);
}

.search-icon {
    padding: 0 15px;
    color: #adb5bd;
    font-size: 1.4rem;
}

.search-input {
    flex: 1;
    border: none;
    border-right: none;
    border-radius: 0;
    padding: 12px 10px;
    font-size: 1.4rem;
    height: auto;
    margin: 0;
    min-width: 0;
    background: #fff;
}

.search-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.search-input::placeholder {
    color: #adb5bd;
}

.search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    color: #6c757d;
    text-decoration: none;
    border-left: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.search-btn {
    border-radius: 0;
    margin: 0;
    padding: 12px 20px;
    white-space: nowrap;
    height: auto;
}

.search-btn i {
    margin-right: 5px;
}

.search-results-info {
    padding-top: 12px;
    margin-top: 15px;
    border-top: 1px dashed #dee2e6;
    font-size: 1.3rem;
    color: #6c757d;
}

.search-results-info i {
    color: #33C3F0;
    margin-right: 5px;
}

.search-results-info strong {
    color: #333;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header .btn {
        margin-top: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        margin-bottom: 15px;
    }
    
    .search-box {
        padding: 15px;
    }
    
    .search-input-wrapper {
        max-width: 100%;
        flex-wrap: wrap;
    }
    
    .search-input {
        flex: 1;
        min-width: 150px;
    }
    
    .search-btn {
        padding: 12px 15px;
    }
}
