/* ==========================================================================
   SNACK PABLO - Custom Theme CSS
   Primary: #2a9d9c | White: #ffffff | Dark: #1a6b6b
   Tablet-first design with big touch targets
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES
   -------------------------------------------------------------------------- */
:root {
    --sp-primary:       #2a9d9c;
    --sp-primary-dark:  #1a7a79;
    --sp-primary-light: #4dc5c4;
    --sp-primary-soft:  rgba(42, 157, 156, 0.12);
    --sp-white:         #ffffff;
    --sp-bg:            #f4f9f9;
    --sp-sidebar-bg:    #1c3a3a;
    --sp-sidebar-text:  #b8d4d4;
    --sp-sidebar-hover: rgba(42, 157, 156, 0.25);
    --sp-sidebar-active:#2a9d9c;
    --sp-touch-min:     52px;
    --sp-radius:        10px;
    --sp-shadow:        0 3px 16px rgba(42,157,156,0.12);
}

/* --------------------------------------------------------------------------
   2. OVERRIDE BOOTSTRAP/SKOTE PRIMARY COLOR → TEAL
   -------------------------------------------------------------------------- */
a { color: var(--sp-primary); }
a:hover { color: var(--sp-primary-dark); }

.btn-primary,
.btn-danger { /* skote uses danger as primary CTA */
    background-color: var(--sp-primary) !important;
    border-color: var(--sp-primary) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-danger:hover {
    background-color: var(--sp-primary-dark) !important;
    border-color: var(--sp-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--sp-primary) !important;
    border-color: var(--sp-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--sp-primary) !important;
    color: #fff !important;
}
.text-primary,
.text-danger { color: var(--sp-primary) !important; }

.bg-primary,
.bg-danger { background-color: var(--sp-primary) !important; }

.bg-primary.bg-soft.bg-logo,
.bg-logo{background-color: #138793 !important;};
.bg-primary.bg-soft,
.bg-soft { background-color: var(--sp-primary-soft) !important; }

.badge-primary { background-color: var(--sp-primary) !important; }

.form-control:focus,
.form-select:focus {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 0.2rem rgba(42, 157, 156, 0.25);
}

/* --------------------------------------------------------------------------
   3. PAGE BACKGROUND
   -------------------------------------------------------------------------- */
body { background-color: var(--sp-bg); }

/* --------------------------------------------------------------------------
   4. TOP HEADER BAR
   -------------------------------------------------------------------------- */
#page-topbar {
    background-color: var(--sp-primary) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
#page-topbar .btn,
#page-topbar .header-item {
    color: rgba(255,255,255,0.9) !important;
    min-height: var(--sp-touch-min);
    display: inline-flex;
    align-items: center;
}
#page-topbar .btn:hover,
#page-topbar .header-item:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.15) !important;
}

/* --------------------------------------------------------------------------
   5. SIDEBAR / VERTICAL MENU
   -------------------------------------------------------------------------- */
.vertical-menu {
    background-color: var(--sp-sidebar-bg) !important;
}
.navbar-brand-box {
    background-color: #138793 !important;
}
.logo-lg img,
.logo-sm img {
    max-height: 50px;
    object-fit: contain;
}

/* Sidebar menu items */
#sidebar-menu ul li a {
    color: var(--sp-sidebar-text) !important;
    padding: 13px 20px !important;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    margin: 2px 8px;
    min-height: var(--sp-touch-min);
    display: flex !important;
    align-items: center;
    transition: all 0.2s ease;
}
#sidebar-menu ul li a:hover,
#sidebar-menu ul li a.active {
    color: #fff !important;
    background-color: var(--sp-sidebar-hover) !important;
}
#sidebar-menu ul li.mm-active > a {
    color: #fff !important;
    background-color: var(--sp-sidebar-active) !important;
}
#sidebar-menu ul li a i {
    color: var(--sp-primary-light) !important;
    font-size: 18px;
    margin-right: 10px;
    width: 24px;
    text-align: center;
}
#sidebar-menu ul li.mm-active > a i {
    color: #fff !important;
}

/* Sub-menu */
#sidebar-menu ul li .sub-menu li a {
    padding: 10px 20px 10px 52px !important;
    font-size: 13px;
    min-height: 44px;
}

/* --------------------------------------------------------------------------
   6. MAIN CONTENT AREA
   -------------------------------------------------------------------------- */
.main-content { background-color: var(--sp-bg); }
.page-content { padding: 81px 20px 24px 20px;}

/* Cards */
.card {
    border: none !important;
    border-radius: var(--sp-radius) !important;
    box-shadow: var(--sp-shadow) !important;
}
.card-header {
    background-color: var(--sp-primary) !important;
    color: #fff !important;
    border-radius: var(--sp-radius) var(--sp-radius) 0 0 !important;
    padding: 16px 20px;
    font-weight: 600;
}

/* Page title */
.page-title-box h4 {
    color: var(--sp-primary-dark);
    font-weight: 700;
}

/* Breadcrumb */
.breadcrumb-item a { color: var(--sp-primary); }
.breadcrumb-item.active { color: #6c757d; }

/* --------------------------------------------------------------------------
   7. FORMS - BIG TOUCH TARGETS
   -------------------------------------------------------------------------- */
.form-control,
.form-select {
    min-height: 48px;
    font-size: 15px;
    border-radius: 8px;
    padding: 10px 14px;
}
.form-label {
    font-weight: 600;
    font-size: 14px;
    color: #444;
    margin-bottom: 6px;
}
.form-group.mb-3 { margin-bottom: 20px !important; }

/* Buttons - big touch targets */
.btn {
    min-height: 48px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-sm {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   8. LOGIN / UNCONNECTED PAGES
   -------------------------------------------------------------------------- */
.account-pages {
    background: linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.account-pages .card {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important;
}
.account-pages .bg-primary.bg-soft,
.account-pages .bg-soft {
    background: var(--sp-primary) !important;
    padding: 30px 24px;
    text-align: center;
}
.main-logo-login img {
    /*max-height: 80px;
    max-width: 220px;*/
    object-fit: contain;
}
.account-pages .card-body {
    padding: 32px 28px;
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.footer {
    background-color: var(--sp-sidebar-bg) !important;
    color: var(--sp-sidebar-text) !important;
    border-top: 2px solid var(--sp-primary);
    padding: 16px 0;
}

/* --------------------------------------------------------------------------
   10. DATATABLES
   -------------------------------------------------------------------------- */
table.dataTable thead th {
    background-color: var(--sp-primary) !important;
    color: #fff !important;
    border-color: var(--sp-primary-dark) !important;
    padding: 14px 12px !important;
    font-size: 13px;
    font-weight: 600;
}
table.dataTable tbody tr { font-size: 14px; }
table.dataTable tbody tr:hover td {
    background-color: var(--sp-primary-soft) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--sp-primary) !important;
    border-color: var(--sp-primary) !important;
    color: #fff !important;
}

/* --------------------------------------------------------------------------
   11. ===== TABLET & MOBILE DESIGN =====
       Breakpoint ≤ 1024px → Burger menu + big buttons
   -------------------------------------------------------------------------- */

/* --- BURGER BUTTON visible on tablet --- */
#vertical-menu-btn {
    display: none;
}

@media (max-width: 1024px) {

    /* Show burger button */
    #vertical-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        font-size: 22px;
        color: #fff !important;
        background: rgba(255,255,255,0.15);
        border-radius: 8px;
        border: none;
    }
    #vertical-menu-btn:hover {
        background: rgba(255,255,255,0.25);
    }

    /* Sidebar hidden by default on tablet */
    .vertical-menu {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
        transition: transform 0.3s ease;
    }

    /* When open (toggled by JS) */
    .vertical-menu.sp-menu-open {
        display: block !important;
    }

    /* Overlay behind open menu */
    .sp-menu-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    .sp-menu-overlay.active { display: block; }

    /* Main content full width on tablet */
    .main-content { margin-left: 0 !important; }

    /* Sidebar items bigger for touch */
    #sidebar-menu ul li a {
        padding: 16px 20px !important;
        font-size: 16px !important;
        min-height: 58px !important;
    }
    #sidebar-menu ul li a i {
        font-size: 22px !important;
    }

    /* Close button inside menu */
    .sp-sidebar-close {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        padding: 16px 16px 8px;
    }
    .sp-sidebar-close button {
        background: rgba(255,255,255,0.15);
        border: none;
        border-radius: 8px;
        color: #fff;
        font-size: 20px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    /* Page content padding */
    .page-content { padding: 81px 12px 16px 12px;}

    /* Logo in topbar */
    .navbar-brand-box { width: auto !important; padding: 0 16px; }
    .logo-lg { display: none; }
    .logo-sm { display: block !important; }

    /* Table - stack action buttons */
    .btn-group .btn { min-height: 44px; }
}

@media (max-width: 768px) {
    .page-content { padding: 81px 8px 16px 8px;}
    .card-body { padding: 16px; }

    /* Full width forms on mobile */
    .col-sm-6, .col-md-4, .col-md-6, .col-md-8 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* DataTables responsive */
    .dataTables_wrapper .row { flex-direction: column; gap: 8px; }
    table.dataTable tbody tr td { padding: 12px 8px; }
}

/* --------------------------------------------------------------------------
   12. DASHBOARD - BIG BUTTON TILES (compatible tablette)
   -------------------------------------------------------------------------- */
.sp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 8px 0;
}

.sp-dashboard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    padding: 28px 16px 22px;
    text-decoration: none !important;
    color: var(--sp-primary-dark) !important;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.25s ease;
    min-height: 130px;
    border: 2px solid transparent;
    cursor: pointer;
}
.sp-dashboard-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(42,157,156,0.22) !important;
    border-color: var(--sp-primary);
    color: var(--sp-primary) !important;
}
.sp-dashboard-tile:active {
    transform: translateY(-1px);
}
.sp-dashboard-tile .sp-tile-icon {
    font-size: 42px;
    color: var(--sp-primary);
    margin-bottom: 12px;
    line-height: 1;
}
.sp-dashboard-tile .sp-tile-label {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    line-height: 1.3;
}

@media (max-width: 1024px) {
    .sp-dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
    .sp-dashboard-tile {
        padding: 24px 12px 18px;
        min-height: 120px;
    }
    .sp-dashboard-tile .sp-tile-icon { font-size: 36px; }
}

@media (max-width: 480px) {
    .sp-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .sp-dashboard-tile {
        padding: 20px 10px 16px;
        min-height: 110px;
    }
    .sp-dashboard-tile .sp-tile-icon { font-size: 32px; }
    .sp-dashboard-tile .sp-tile-label { font-size: 12px; }
}

/* --------------------------------------------------------------------------
   13. DROPZONE / IMAGE UPLOAD
   -------------------------------------------------------------------------- */
.container-profil-logo > .profil-logo .dz-preview,
.container-profil-image > .profil-image .dz-preview { display: none; }

.container-profil-logo > .profil-logo,
.container-profil-image > .profil-image {
    text-align: center;
    display: block;
    width: 190px;
    height: 190px;
    margin: 0 auto;
    cursor: pointer;
}
.container-profil-logo > .profil-logo {
    height: auto; background: #fff; width: 250px; max-width: 100%;
}
.container-profil-logo > .profil-logo .empty-logo,
.container-profil-image > .profil-image .empty-image {
    border: 2px dashed #dee2e6;
    padding: 30px 0;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}
.container-profil-logo > .profil-logo .empty-logo:hover,
.container-profil-image > .profil-image .empty-image:hover {
    border-color: var(--sp-primary);
    background-color: var(--sp-primary-soft);
}
.container-profil-image .dz-message i,
.container-profil-logo .dz-message i {
    color: var(--sp-primary);
    font-size: 48px;
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   14. SCROLLBAR
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f4f4; }
::-webkit-scrollbar-thumb { background: var(--sp-primary-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sp-primary); }
