
/* ===== Global UI Scale ===== */
html {
    font-size: 14px; /* default is 16px */
}

:root {
    --primary: #006666;
    --sidebar-text: #b9dddd;
    --sidebar-icon: #9fcfcf;
    --sidebar-hover: #ffffff;
    --bg: #f6f7f9;
}

body {
    margin: 0;
    background: var(--bg);
    font-family: 'Inter', system-ui, sans-serif;
}
/* ===== Compact Forms ===== */
.form-label {
    font-size: 13px;
    margin-bottom: 4px;
}

.form-control,
.form-select {
    font-size: 13px;
    padding: 6px 10px;
}

textarea.form-control {
    min-height: 70px;
}
/* ===== Compact Modals ===== */
/*.modal-dialog {
    max-width: 520px;
}*/

.modal-header {
    padding: 10px 16px;
}

.modal-body {
    padding: 14px 16px;
}

.modal-footer {
    padding: 10px 16px;
}

.modal-title {
    font-size: 15px;
}
/* ===== Sidebar ===== */
.menu-item {
    font-size: 14px;
    padding: 10px 20px;
}

    .menu-item i {
        font-size: 16px;
    }

/* ===== Page Content ===== */
.content {
    padding: 20px;
}

/* ================= SIDEBAR ================= */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    /*background: var(--primary);*/
    background-color: #26806f;
    transition: width .3s ease;
    overflow: hidden;
}

    .sidebar.collapsed {
        width: 80px;
    }

.brand {
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #fff;
}

/* Menu */
.menu small {
    display: block;
    padding: 6px 24px 6px;
    font-size: 13px;
    letter-spacing: .6px;
    color: white;
}

/* Menu Items */
.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    font-size: 15px; /* updated font size */
    color: var(--sidebar-text);
    transition: .2s;
    cursor: pointer;
}

    .menu-item i {
        font-size: 18px;
        color: var(--sidebar-icon);
    }

    /* Hover */
    .menu-item:hover {
        background: rgba(255,255,255,.12);
        color: #fff;
    }

        .menu-item:hover i {
            color: #fff;
        }

    /* Active */
    .menu-item.active {
        background: rgba(255,255,255,.18);
        color: #fff;
    }

        .menu-item.active i {
            color: #fff;
        }

/* Chevron */
.chevron {
    margin-left: auto;
    font-size: 14px;
    color: #cceeee;
    transition: transform .25s;
}

.menu-item.open .chevron {
    transform: rotate(90deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    padding-left: 56px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

    .submenu a {
        display: block;
        padding: 6px 0;
        font-size: 13px;
        color: #cfeeee !important; /* force light cyan */
        text-decoration: none;
        cursor: pointer;
        transition: color 0.2s;
    }

        .submenu a:hover {
            color: #ffffff !important;
        }

/* Open submenu */
.menu-item.open + .submenu {
    max-height: 200px; /* enough for links */
    opacity: 1;
}

/* Collapse behavior */
.sidebar.collapsed span,
.sidebar.collapsed small,
.sidebar.collapsed .submenu,
.sidebar.collapsed .chevron {
    display: none;
}

/* ================= MAIN ================= */
.main {
    margin-left: 260px;
    transition: margin-left .3s ease;
}

    .main.expanded {
        margin-left: 80px;
    }

/*
 * Persisted collapse: class set on <html> in _Layout <head> from localStorage
 * before body paints, so width/margin match immediately (no flash).
 * Values align with _Sidebar inline .sidebar.collapsed (70px).
 */
html.sidebar-collapsed .sidebar {
    width: 70px !important;
}

html.sidebar-collapsed .main {
    margin-left: 70px !important;
}

html.sidebar-collapsed .sidebar .logo-full {
    display: none !important;
}

html.sidebar-collapsed .sidebar .logo-small {
    display: block !important;
}

html.sidebar-collapsed .sidebar span,
html.sidebar-collapsed .sidebar small,
html.sidebar-collapsed .sidebar .submenu,
html.sidebar-collapsed .sidebar .chevron,
html.sidebar-collapsed .sidebar .menu-title {
    display: none !important;
}

html.sidebar-collapsed .sidebar .menu-item {
    justify-content: center;
}

/* ================= TOPBAR ================= */
.topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
}

    .toggle-btn:hover {
        background: #e3f2f2;
    }

/* Search */
.search {
    position: relative;
}

    .search input {
        width: 280px;
        padding: 10px 16px 10px 42px;
        border: none;
        border-radius: 11px;
        background: #f1f3f6;
        font-size: 14px;
    }

    .search i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
    }

/* ================= CONTENT ================= */
.content {
    padding: 28px;
}

.card-soft {
    background: #fff;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

    .card-soft h6 {
        font-size: 13px;
        color: #6b7280;
    }

    .card-soft h3 {
        margin: 0;
        font-weight: 600;
    }

/* Remove underline from all sidebar links */
.sidebar a {
    text-decoration: none !important;
}

    /* Also prevent underline on hover/focus */
    .sidebar a:hover,
    .sidebar a:focus {
        text-decoration: none !important;
    }

/* ===== TOPBAR ===== */
.topbar {
    height: 58px;
    background: #ffffff;
    border-bottom: 1px solid #e5efec;
}

/* Title */
.topbar-title div {
    color: #26806f;
    font-size: 15px;
}

/* Toggle */
.toggle-btn {
    cursor: pointer;
    color: #26806f;
}

/* ===== PROFILE CHIP ===== */
.profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f8f7;
    border: 1px solid #e0efec;
    border-radius: 30px;
    padding: 5px 12px 5px 6px;
    cursor: pointer;
}

.profile-chip:hover {
    background: #eaf4f2;
}

/* Avatar */
.profile-avatar {
    width: 36px;
    height: 36px;
    background: #26806f;
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Name */
.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #26806f;
    line-height: 1;
}

.profile-info small {
    font-size: 11px;
    color: #6c757d;
}

.btn-primary {
    background-color: #26806f;
    border-color: #26806f;
    font-weight: 600;
}

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

    .btn-primary:disabled {
        background-color: #26806f;
        border-color: #26806f;
        opacity: 0.8;
        cursor: not-allowed;
    }

/* Saving state */
.btn-saving {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
@keyframes rowHighlight {
    from {
        background-color: #e6f4f1;
    }

    to {
        background-color: transparent;
    }
}

.row-updated {
    animation: rowHighlight 2s ease-out;
}
.required {
    color: #dc3545;
    margin-left: 3px;
}

/* Invalid input styling */
.field-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.1rem rgba(220, 53, 69, 0.15);
}

/* Inline error text */
.field-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
}

/* Shake animation */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.3s ease-in-out;
}
.required {
    color: #dc3545;
    margin-left: 4px;
}

.field-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.1rem rgba(220, 53, 69, 0.15);
}

.field-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}
/* CARD */
.data-card {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* HEADER */
.card-header-custom {
    /*background: linear-gradient(135deg, #2fa08a, #3bb39a);
    padding: 18px 24px;
    color: #fff;*/
    /* background: linear-gradient(135deg, #e7f7f2, #719b8e);*/
    border-top: 3px solid #d2d6de;
    border-top-color: #a2c9b7;
    border-bottom-style: inset;
    padding: 18px 24px;
    color: #2fa08a;
}

/* SEARCH */
.search-wrapper {
    position: relative;
    width: 280px;
}

    .search-wrapper input {
        height: 33px;
        padding-left: 38px;
        padding-right: 32px;
        border-radius: 8px;
    }

    .search-wrapper i {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        color: #999;
    }

    .search-wrapper .bi-search {
        left: 12px;
    }

    .search-wrapper .clear-btn {
        right: 10px;
        cursor: pointer;
    }

/* TABLE */
.table thead th {
    background: #f4f7f8;
    font-size: 13px;
    text-transform: uppercase;
}

/* STATUS */
.status-pill {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #e7f7f2;
    color: #2fa08a;
}

.status-inactive {
    background: #fdeaea;
    color: #d9534f;
}

/* FOOTER */
.card-footer-custom {
    background: #f9fbfc;
    padding: 14px 24px;
    font-size: 13px;
    color: #666;
}
.status-warning {
    background-color: #fff3cd; /* light yellow */
    color: #856404; /* dark yellow text */
    border: 1px solid #ffeeba;
}
/* ONLY delete payments modal */
.delete-payments-modal .modal-header.bg-danger {
    border-bottom: none;
}

.delete-payments-modal .modal-footer {
    border-top: none;
}

.delete-payments-modal .table-sm td,
.delete-payments-modal .table-sm th {
    padding: 0.45rem;
}
/* Add Payment modal ONLY */
.add-payment-modal .form-label {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.add-payment-modal .fw-semibold {
    font-size: 0.95rem;
}

/* =============================================================================
   Responsive layout (mobile / tablet / small laptop) — UI only
   ============================================================================= */

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

body.sidebar-mobile-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.content img,
.sidebar img,
.brand img,
.logo-full,
.logo-small {
    max-width: 100%;
    height: auto;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Small laptops and below */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translate3d(-100%, 0, 0);
        transition: transform 0.3s ease, width 0.3s ease;
        z-index: 1040;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.18);
    }

    body.sidebar-mobile-open .sidebar {
        transform: translate3d(0, 0, 0);
    }

    .main,
    .main.expanded,
    html.sidebar-collapsed .main {
        margin-left: 0 !important;
    }

    /* Drawer always full width; show labels even if desktop sidebar was collapsed */
    .sidebar.collapsed,
    html.sidebar-collapsed .sidebar {
        width: 260px !important;
    }

    html.sidebar-collapsed .sidebar span,
    html.sidebar-collapsed .sidebar small,
    html.sidebar-collapsed .sidebar .menu-title,
    .sidebar.collapsed span,
    .sidebar.collapsed small,
    .sidebar.collapsed .menu-title {
        display: inline !important;
    }

    html.sidebar-collapsed .sidebar .menu-item,
    .sidebar.collapsed .menu-item {
        justify-content: flex-start !important;
    }

    html.sidebar-collapsed .sidebar .logo-full,
    .sidebar.collapsed .logo-full {
        display: block !important;
    }

    html.sidebar-collapsed .sidebar .logo-small,
    .sidebar.collapsed .logo-small {
        display: none !important;
    }

    html.sidebar-collapsed .sidebar .submenu,
    .sidebar.collapsed .submenu {
        display: block !important;
    }

    .sidebar .menu {
        overflow-y: auto;
        max-height: calc(100vh - 64px);
        -webkit-overflow-scrolling: touch;
    }

    .content {
        padding: 16px;
    }

    .card-header-custom {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .card-header-custom .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100% - 1.5rem);
    }
}

/* Tablet */
@media (max-width: 767.98px) {
    html {
        font-size: 15px;
    }

    body {
        overflow-x: hidden;
    }

    .topbar {
        min-height: 58px;
        height: auto;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .search input {
        width: 100%;
        max-width: 100%;
    }

    .toggle-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .content {
        padding: 12px;
    }

    .card-header-custom,
    .card-footer-custom {
        padding-left: 14px;
        padding-right: 14px;
    }

    .data-card .btn-sm {
        min-height: 40px;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .form-control,
    .form-select {
        width: 100%;
        max-width: 100%;
    }

    .card-footer-custom.d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
    }
}

/* Mobile */
@media (max-width: 575.98px) {
    .content {
        padding: 10px;
    }

    .menu-item {
        padding-left: 18px;
        padding-right: 18px;
    }

    .brand,
    .sidebar-header {
        padding-left: 16px;
        padding-right: 16px;
    }
}
