:root {
    --font-common: 'Nunito', sans-serif;
    --font-size-common: 15px;
    --font-size-common-1: 14px;
}
body {
    font-family: var(--font-common)!important;
    font-size: var(--font-size-common)!important;
}
.btn {
    letter-spacing: normal;
    font-size: var(--font-size-common);
}
.modal .btn-close {
    content: 'A';
}
.section {
    position: static;
}

table.t1 tr td {
    border-top: 1px solid #e3e3e3;
}

.card.card-statistic-1 .card-header h4, .card.card-statistic-2 .card-header h4 {
    letter-spacing: normal;
}
.w_40 {width: 40px!important;}
.w_50 {width: 50px!important;}
.w_100 {width: 100px!important;}
.w_150 {width: 150px!important;}
.w_200 {width: 200px!important;}
.w_300 {width: 300px!important;}
.w_400 {width: 400px!important;}
.w_450 {width: 450px!important;}
.w_100_p {width: 100%!important;}

.h_100 {height: 100px!important;}
.h_150 {height: 150px!important;}
.h_200 {height: 200px!important;}
.h_300 {height: 300px!important;}
.h_350 {height: 350px!important;}
.h_400 {height: 400px!important;}

.fz_20 {font-size: 20px!important;}
.fz_30 {font-size: 30px!important;}
.fz_40 {font-size: 40px!important;}
.fz_50 {font-size: 50px!important;}

.rounded-circle-custom {
    width:40px;
    height:40px;
    border-radius: 50%;
}

.section-header h1 a {
    color: #6777ef;
    text-decoration: none;
}

.table-borderless td {
    border: 0 !important;
    padding: 5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-size: var(--font-size-common);
    font-weight: 600;
    margin-bottom: 5px;
}

.form-control {
    font-size: var(--font-size-common);
    border-color: #e3e6ef;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #6777ef;
    box-shadow: 0 0 0 0.2rem rgba(103, 119, 239, 0.25);
}

.section .section-title {
    font-size: var(--font-size-common);
    font-weight: 600;
}

.section .section-lead {
    color: #828ba2;
    font-size: var(--font-size-common);
    margin-bottom: 20px;
}

.section .section-header .btn {
    font-size: var(--font-size-common)!important;
}

.main-sidebar .sidebar-brand {
    padding-left: 20px;
    padding-right: 20px;
    text-align: left;
}

.main-sidebar .sidebar-brand a {
    text-transform: none;
    letter-spacing: normal;
    font-size: 18px;
    font-weight: 600;
}

.main-sidebar .sidebar-menu li a span {
    font-size: var(--font-size-common-1)!important;
}

.main-sidebar .sidebar-menu li a {
    letter-spacing: normal;
    padding-left: 10px;
    padding-right: 10px;
    height: 40px;
}

.main-sidebar .sidebar-menu li a i {
    margin-right: 5px;
    margin-top: 5px;
}

.main-sidebar .sidebar-menu li ul.dropdown-menu li a {
    padding-left: 46px;
    font-size: var(--font-size-common-1);
}

.main-sidebar .sidebar-menu li ul.dropdown-menu li a i {
    width: 18px;
    margin-right: 0;
}

.main-sidebar .sidebar-menu li a.has-dropdown:after {
    top: 55%;
}

.main-sidebar .sidebar-menu li.active a,
.main-sidebar .sidebar-menu li ul.dropdown-menu li.active > a {
    font-weight: 400;
}

.sub-sidebar {
    font-size: var(--font-size-common);
    background: #e5e8f8;
    margin-bottom: 5px;
}

.card.card-statistic-1 .card-header h4 {
    font-size: var(--font-size-common);
}

/* ======= RESPONSIVE DASHBOARD STYLES ======= */

/* Dashboard Statistics Cards Responsive */
.dashboard-stats-row .card {
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card.card-statistic-1 {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.card-statistic-1:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive Icons */
.responsive-icon {
    font-size: 2rem;
    transition: font-size 0.3s ease;
}

.responsive-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.responsive-number {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

/* Quick Actions Responsive */
.btn-responsive {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-responsive:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile Display Controls */
.mobile-hide {
    display: inline;
}

.mobile-show {
    display: none;
}

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

/* Large Tablets and Small Desktops (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-content {
        padding: 20px;
    }

    .responsive-title {
        font-size: 0.85rem;
    }

    .responsive-number {
        font-size: 1.8rem;
    }

    .responsive-icon {
        font-size: 1.8rem;
    }
}

/* Small Tablets (576px - 768px) */
@media (max-width: 768px) and (min-width: 577px) {
    .main-content {
        padding: 15px;
    }

    .section-header h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .responsive-title {
        font-size: 0.8rem;
    }

    .responsive-number {
        font-size: 1.6rem;
    }

    .responsive-icon {
        font-size: 1.6rem;
    }

    .btn-responsive {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Mobile Phones (≤576px) */
@media (max-width: 576px) {
    .main-content {
        padding: 10px;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .section-header h1 {
        font-size: 20px;
        margin-bottom: 0;
    }

    /* Dashboard Cards Mobile */
    .dashboard-stats-row .card .card-body {
        padding: 15px;
    }

    .card.card-statistic-1 {
        margin-bottom: 15px;
    }

    .responsive-title {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .responsive-number {
        font-size: 1.4rem;
    }

    .responsive-icon {
        font-size: 1.4rem;
    }

    /* Quick Actions Mobile */
    .btn-responsive {
        padding: 8px 12px;
        font-size: 12px;
    }

    .mobile-hide {
        display: none;
    }

    .mobile-show {
        display: inline;
    }

    /* Card spacing optimization */
    .card {
        margin-bottom: 15px;
    }

    .card-header {
        padding: 15px 20px 10px;
    }

    .card-body {
        padding: 10px 20px 20px;
    }
}

/* Extra Small Devices (≤480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 8px;
    }

    .section-header h1 {
        font-size: 18px;
    }

    .responsive-title {
        font-size: 0.7rem;
    }

    .responsive-number {
        font-size: 1.2rem;
    }

    .responsive-icon {
        font-size: 1.2rem;
    }

    .btn-responsive {
        padding: 6px 10px;
        font-size: 11px;
    }

    .card-header {
        padding: 12px 15px 8px;
    }

    .card-body {
        padding: 8px 15px 15px;
    }
}

/* Essential responsive classes used in dashboard */
.responsive-icon {
    font-size: 2rem;
    transition: font-size 0.3s ease;
}

.responsive-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.responsive-number {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.btn-responsive {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-hide {
    display: inline;
}

.mobile-show {
    display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .responsive-title {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .responsive-number {
        font-size: 1.4rem;
    }

    .responsive-icon {
        font-size: 1.4rem;
    }

    .btn-responsive {
        padding: 8px 12px;
        font-size: 12px;
    }

    .mobile-hide {
        display: none;
    }

    .mobile-show {
        display: inline;
    }
}

/* Fix sidebar scrolling performance - use native scrolling */
.main-sidebar {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* ======= SIMPLIFIED NAVBAR FIXES (Following Stisla Template) ======= */

/* Keep original Stisla navbar behavior - just fix z-index conflicts */
.main-sidebar {
    z-index: 891 !important; /* Ensure sidebar is above navbar when needed */
}

/* Fix navbar right alignment */
.main-navbar {
    display: flex !important;
    justify-content: space-between !important;
}

.navbar-nav.navbar-right {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
}

.rightsidetop {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
}

/* Hamburger button purple theme color */
.main-navbar .nav-link[data-toggle="sidebar"] {
    color: #6777ef !important; /* Purple theme color */
}

.main-navbar .nav-link[data-toggle="sidebar"]:hover {
    color: #5a67d8 !important; /* Darker purple on hover */
}

/* Mobile navbar fixes */
@media (max-width: 767px) {
    .main-navbar {
        padding: 0.5rem 1rem !important;
    }

    .rightsidetop {
        gap: 0.5rem !important;
    }

    .rightsidetop .nav-link {
        padding: 0 !important;
    }

    .rightsidetop .btn {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.875rem !important;
    }

    /* Fix Home button alignment on mobile */
    .navbar-nav.navbar-right {
        flex-direction: row !important;
        align-items: center !important;
        margin-left: auto !important;
    }
}

/* ======= SIMPLIFIED TABLE RESPONSIVE (Following Stisla Template) ======= */

/* Simple responsive table behavior - let Stisla handle sidebar states */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Desktop - keep original Stisla behavior */
@media (min-width: 1025px) {
    .table {
        min-width: 1200px; /* Conservative width */
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 768px) {
    .table {
        min-width: 1100px;
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
    }

    .qr-code {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Mobile responsive */
@media (max-width: 767px) {
    .table {
        min-width: 1000px; /* Allow horizontal scrolling */
        font-size: 0.7rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.35rem;
        font-size: 0.7rem;
    }

    .qr-code {
        width: 40px !important;
        height: 40px !important;
    }

    .table .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
    }
}

/* Small mobile - keep simple */
@media (max-width: 576px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header .ml-auto {
        margin-left: 0 !important;
        margin-top: 1rem;
        width: 100%;
    }

    .section-header .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .table {
        min-width: 900px;
    }

    .table th,
    .table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.65rem;
    }

    .qr-code {
        width: 35px !important;
        height: 35px !important;
    }
}

/* Keep original Stisla responsive behavior - only minimal mobile improvements */
@media (max-width: 768px) {
    .main-content {
        padding: 10px;
    }
}

/* Minimal mobile improvements - keep original Stisla behavior */

/* ======= RESPONSIVE TABLES & CONTENT ======= */

@media (max-width: 768px) {
    /* Responsive tables */
    .table-responsive {
        border: none;
    }

    .table {
        font-size: 0.875rem;
    }

    .table td,
    .table th {
        padding: 0.5rem;
        white-space: nowrap;
    }

    /* Form improvements */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 15px;
    }

    .btn {
        min-height: 44px;
        font-size: 16px;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
}

/* ======= PRINT STYLES ======= */
@media print {
    .main-sidebar,
    .navbar,
    .section-header .btn,
    .btn-responsive {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
}