:root {
    color-scheme: light;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    background-color: #eef3f8;
    color: #1f2937;
}

/* Mobile First - Adjust root font size for small screens */
@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    :root {
        font-size: 15px;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #eef3f8;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 100%);
}

.login-page {
    width: min(480px, 100%);
}

.login-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 36px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #FF9933;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
}

.brand-name {
    color: #FF9933;
}

.brand-subtitle {
    color: #64748b;
    font-size: 14px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.app-shell {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #cc7a29;
    color: #fff;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 78px;
    min-width: 78px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar.collapsed .sidebar-group-title span,
.sidebar.collapsed .sidebar-group-sign {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.sidebar-brand strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-brand strong {
    color: #FF9933;
}

.sidebar-brand span {
    display: block;
    font-size: 12px;
    color: #cfd8ff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    /* thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.sidebar-section-label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem 0.5rem;
    margin-top: 0.5rem;
    color: #cfd8ff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #e8f0ff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
    cursor: pointer;
}

.sidebar-group-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.sidebar-group-title {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-group-title i {
    font-size: 1rem;
}

.sidebar-group-sign {
    width: 18px;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
    font-weight: 700;
}

.sidebar-group-content {
    display: none;
    flex-direction: column;
    gap: 0.3rem;
    padding-left: 0.35rem;
}

.sidebar-group.expanded .sidebar-group-content {
    display: flex;
}

.sidebar-group .sidebar-link {
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    color: #e8f0ff;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link i {
    font-size: 1.2rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
}

.logout-link {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1rem;
}

.app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: #eef3f8;
}

.app-main.sidebar-collapsed {
    margin-left: 78px;
    width: calc(100% - 78px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: #ffffff;
    border-bottom: 1px solid #e9edf6;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-title h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.topbar-title p {
    margin: 0;
    color: #667085;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: #f8f9ff;
    color: #0f172a;
    font-weight: 500;
}

/* Employee Management page layout refinement */
.employees-page .app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
}

.employees-page .employees-main-content {
    width: 100%;
    max-width: 100%;
    padding: 20px 24px;
}

.employees-page .employees-container {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.employees-page .employees-header {
    margin-bottom: 1rem;
}

.employees-page .employees-header h3 {
    margin: 0;
}

.employees-page .employees-header-actions {
    margin-left: auto;
}

.employees-page .employees-search-card .card-body {
    padding: 1rem 1.25rem;
}

.employees-page .employees-search-row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.employees-page .employees-metrics-grid .col {
    display: flex;
}

.employees-page .employees-metrics-grid .summary-card {
    width: 100%;
    height: 100%;
    min-height: 92px;
}

.employees-page .employees-table-card {
    width: 100%;
}

.employees-page .employees-table-card .table-responsive {
    width: 100%;
}

.employees-page #employeesTable {
    width: 100% !important;
}

.employees-page .dataTables_wrapper {
    width: 100%;
}

.employees-page .card {
    margin-bottom: 1rem;
}

.employees-page .main-content .alert {
    margin-bottom: 1rem;
}

.employees-page .employees-header p {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.employees-page .employees-header .btn {
    min-height: 38px;
    padding: 0.45rem 0.95rem;
}

.employees-page .employees-search-card {
    border-radius: 14px;
}

.employees-page .employees-search-card .form-label {
    font-size: 0.82rem;
    color: #607086;
    margin-bottom: 0.35rem;
}

.employees-page .employees-search-card .form-control,
.employees-page .employees-search-card .form-select,
.employees-page .employees-search-card .btn {
    min-height: 42px;
}

.employees-page .summary-card {
    border-radius: 14px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.employees-page .summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 34px;
}

.employees-page .summary-icon i {
    font-size: 0.95rem;
}

.employees-page .summary-info {
    margin-left: 0.7rem;
    min-width: 0;
}

.employees-page .summary-label {
    display: block;
    font-size: 0.8rem;
    line-height: 1.2;
    color: #63748b;
    margin-bottom: 0.15rem;
}

.employees-page .summary-value {
    display: block;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 700;
    color: #1f2d3d;
}

.employees-page .employees-table-card .card-header {
    padding: 0.9rem 1rem;
}

.employees-page .employees-table-card .table th,
.employees-page .employees-table-card .table td {
    padding: 0.5rem 0.55rem;
    font-size: 0.84rem;
    white-space: nowrap;
}

.employees-page .employees-table-card .table td .badge {
    font-size: 0.74rem;
    padding: 0.28rem 0.5rem;
}

.employees-page .employees-table-card .btn-group .btn {
    padding: 0.22rem 0.5rem;
}

.employees-page .dataTables_wrapper .dataTables_filter input {
    min-height: 34px;
    padding: 0.25rem 0.55rem;
}

.employees-page .dataTables_wrapper .dataTables_length select {
    min-height: 34px;
}

.page-content {
        padding: 0.6rem 0.85rem 0.85rem;
        overflow-x: hidden;
    }

    .page-header {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 0.65rem;
        margin-bottom: 0.8rem;
    }

    .payments-page .payment-entry-card {
        min-height: auto;
        max-height: 28vh;
        margin-bottom: 0.35rem;
        border-radius: 14px;
        overflow: hidden;
    }

    .payments-page .payment-entry-card .card-header {
        padding: 0.75rem 0.85rem 0.55rem;
    }

    .payments-page .payment-entry-card .card-body {
        padding: 0.65rem 0.85rem 0.5rem;
    }

    .payments-page .payment-entry-card .form-control,
    .payments-page .payment-entry-card .form-select,
    .payments-page .payment-entry-card textarea {
        min-height: 32px;
        padding: 0.35rem 0.55rem;
        font-size: 0.88rem;
    }

    .payments-page .payment-entry-card label {
        font-size: 0.82rem;
        margin-bottom: 0.15rem;
    }

    .payments-page .payment-entry-card .row.gx-3 > [class*='col-'] {
        margin-bottom: 0.3rem;
    }

    .payments-page .payment-entry-card .d-flex {
        gap: 0.35rem;
    }

    .payments-page .remarks-field {
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        resize: none;
    }

    .payments-page .payments-history-table {
        /* Further reduced for denser view: ~8 rows at desktop */
        max-height: calc(36px * 8 + 100px);
        overflow-y: auto;
    }

    /* On medium screens, show ~6 rows */
    @media (max-width: 1400px) {
        .payments-page .payments-history-table {
            max-height: calc(36px * 6 + 90px);
        }
    }

    /* On small screens, show ~4 rows */
    @media (max-width: 992px) {
        .payments-page .payments-history-table {
            max-height: calc(36px * 4 + 80px);
        }
    }

    .payments-page .payments-history-table table {
        margin-bottom: 0;
        font-size: 0.82rem;
        border-collapse: collapse;
    }

    .payments-page .payments-history-table table th,
    .payments-page .payments-history-table table td {
        padding: 6px 8px;
        font-size: 12px;
    }

    .payments-page .payments-history-table tbody tr {
        height: 36px;
    }

    .payments-page .card-body .row.g-3 .form-control,
    .payments-page .card-body .row.g-3 .form-select {
        padding: 6px 8px;
        font-size: 12px;
    }
.page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.summary-card {
    border-radius: 18px;
    padding: 1.35rem 1.5rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 120px;
}

.summary-card p {
    margin: 0 0 0.35rem;
    color: #64748b;
    font-size: 0.95rem;
}

.summary-card h3 {
    margin: 0;
    font-size: 1.5rem;
}

.summary-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #FF9933;
    background: rgba(255, 153, 51, 0.08);
}

.summary-primary { border-left: 4px solid #FF9933; }
.summary-success { border-left: 4px solid #16a34a; }
.summary-info { border-left: 4px solid #0ea5e9; }
.summary-warning { border-left: 4px solid #f59e0b; }
.summary-secondary { border-left: 4px solid #6d28d9; }

.profile-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 1rem 1.15rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.profile-card h6 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #334155;
}

.profile-card p {
    margin: 0;
    font-size: 1rem;
}

.summary-card {
    min-height: 90px;
    padding: 1rem 1.25rem;
}

.summary-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: right;
}

.summary-label {
    color: #667085;
    font-size: 0.9rem;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.quick-links {
    margin-bottom: 1.75rem;
}

.quick-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.4rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.quick-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.quick-card strong {
    font-size: 1rem;
}

.panel-card,
.card {
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
    border: none;
}

.card-header,
.panel-card .card-header {
    background: #ffffff;
    border-bottom: 1px solid #e9edf6;
    padding: 1.25rem 1.5rem;
}

.card-body,
.panel-card .card-body {
    padding: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.table thead {
    background: #f8fafc;
}

.table th,
.table td {
    vertical-align: middle;
}

.alert {
    border-radius: 14px;
}

@media (max-width: 1300px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    /* Sidebar hidden off-screen by default on mobile/tablet */
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .employees-page .employees-main-content {
        padding: 14px;
    }

    .employees-page .employees-header {
        align-items: flex-start !important;
    }

    .employees-page .employees-header-actions {
        margin-left: 0;
        width: 100%;
    }

    .employees-page .employees-table-card .table th,
    .employees-page .employees-table-card .table td {
        font-size: 0.8rem;
        padding: 0.45rem;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: -280px;
        width: 260px !important;
        min-width: 260px !important;
        height: 100vh !important;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    /* Always show full sidebar content when open on mobile */
    .sidebar.mobile-open .brand-text,
    .sidebar.mobile-open .sidebar-link span,
    .sidebar.mobile-open .sidebar-footer,
    .sidebar.mobile-open .sidebar-group-title span,
    .sidebar.mobile-open .sidebar-group-sign {
        display: block !important;
    }

    .sidebar.collapsed {
        width: 260px !important;
        min-width: 260px !important;
        left: -280px;
    }

    .sidebar.collapsed.mobile-open {
        left: 0;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .page-content {
        padding: 1rem;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }

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

    .topbar {
        padding: 0.75rem 1rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .topbar-left {
        flex: 1;
        min-width: 0;
        gap: 0.5rem;
    }

    .topbar-title h1 {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-title p {
        display: none;
    }

    .topbar-actions {
        flex-shrink: 0;
        margin-left: auto;
    }

    .profile-chip {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }

    .profile-chip span {
        display: none;
    }

    .page-content {
        padding: 0.75rem;
    }

    .employees-page .employees-main-content {
        padding: 12px;
    }

    .employees-page .employees-search-card .card-body {
        padding: 0.85rem;
    }

    .employees-page .summary-card {
        min-height: 84px;
    }

    .employees-page .summary-value {
        font-size: 1.15rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .page-header {
        margin-bottom: 0.75rem;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        margin-bottom: 0.75rem;
    }

    /* Last odd card spans full width */
    .summary-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .summary-card {
        min-height: 80px;
        padding: 0.85rem 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .summary-card p {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }

    .summary-card h3 {
        font-size: 1.1rem;
    }

    .summary-badge {
        font-size: 0.72rem;
        padding: 0.3rem 0.55rem;
        min-width: 52px;
    }

    .quick-links {
        margin-bottom: 1rem;
    }

    .quick-card {
        padding: 0.85rem 1rem;
        flex-direction: row;
        text-align: left;
    }

    .quick-card p {
        font-size: 0.85rem;
    }

    .quick-card strong {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-height: 38px;
    }

    .btn-sm {
        min-height: 34px;
        padding: 0.35rem 0.75rem;
        font-size: 0.85rem;
    }

    .form-control,
    .form-select,
    textarea {
        padding: 0.55rem 0.75rem;
        min-height: 40px;
        font-size: 1rem;
    }

    .form-label {
        font-size: 0.88rem;
        margin-bottom: 0.35rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.6rem 0.4rem;
    }

    .table-responsive {
        border-radius: 12px;
    }

    .card {
        border-radius: 14px;
        margin-bottom: 0.75rem;
    }

    .card-header {
        padding: 0.85rem 1rem;
    }

    .card-body {
        padding: 0.85rem 1rem;
    }

    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .badge {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 0.6rem 0.75rem;
    }

    .topbar-title h1 {
        font-size: 0.95rem;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .sidebar-link {
        padding: 0.8rem 0.75rem;
        gap: 0.7rem;
    }

    .page-content {
        padding: 0.5rem;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .summary-card {
        min-height: 70px;
        padding: 0.7rem 0.75rem;
    }

    .summary-card p {
        font-size: 0.72rem;
    }

    .summary-card h3 {
        font-size: 0.95rem;
    }

    .summary-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
        min-width: 44px;
    }

    .card-header {
        padding: 0.7rem 0.75rem;
    }

    .card-body {
        padding: 0.7rem 0.75rem;
    }

    .btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.85rem;
        min-height: 34px;
    }

    .btn-sm {
        min-height: 30px;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        min-height: 36px;
    }

    .table {
        font-size: 0.78rem;
    }

    .table th,
    .table td {
        padding: 0.45rem 0.35rem;
    }

    .row {
        margin-right: -0.375rem;
        margin-left: -0.375rem;
    }

    [class*='col-'] {
        padding-right: 0.375rem;
        padding-left: 0.375rem;
    }
}
        padding: 0.85rem;
        font-size: 0.9rem;
    }

    .quick-card strong {
        font-size: 0.95rem;
    }

    .quick-card p {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.9rem;
        min-height: 36px;
        border-radius: 8px;
    }

    .btn-sm {
        min-height: 32px;
        padding: 0.35rem 0.65rem;
        font-size: 0.85rem;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .form-control,
    .form-select,
    textarea {
        padding: 0.5rem 0.65rem;
        min-height: 36px;
        font-size: 16px;
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.4rem;
    }

    .table-responsive {
        max-height: 60vh;
    }

    .card {
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }

    .card-header {
        padding: 0.85rem;
    }

    .card-body {
        padding: 0.85rem;
    }

    .alert {
        padding: 0.7rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .badge {
        padding: 0.35rem 0.55rem;
        font-size: 0.8rem;
    }

    .row {
        margin-right: -0.375rem;
        margin-left: -0.375rem;
    }

    [class*='col-'] {
        padding-right: 0.375rem;
        padding-left: 0.375rem;
    }

    .d-flex {
        gap: 0.5rem;
    }

    .mb-3 {
        margin-bottom: 0.75rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-content {
        border-radius: 12px;
    }
}

@media (max-width: 360px) {
    .topbar-title h1 {
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
    }

    .table {
        font-size: 0.75rem;
    }
}

/* Tablet Optimizations (480px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .btn {
        min-height: 38px;
    }

    .form-control,
    .form-select {
        min-height: 38px;
    }
}

/* Hide/Show Elements Based on Screen */
@media (max-width: 768px) {
    .d-none-mobile {
        display: none !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.mobile-open {
        display: block;
    }
}

@media (min-width: 769px) {
    .d-none-desktop {
        display: none !important;
    }
}

/* Form Layout Responsive Improvements */
.d-flex.flex-wrap[style*="gap"] {
    gap: 12px;
}

@media (max-width: 768px) {
    .d-flex.flex-wrap[style*="gap"] {
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .d-flex.flex-wrap[style*="gap"] > [style*="flex:"] {
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .payments-page .d-flex > button {
        width: 100%;
    }

    .payments-page .d-flex > a {
        width: 100%;
        text-align: center;
    }
}

/* Bootstrap Responsive Classes */
.col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-sm-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
