﻿/* =========================================================
   HMS CLOUD - LEAN ENTERPRISE UI
   Compact Professional HMS Dashboard
========================================================= */

/* =========================
   ROOT VARIABLES
========================= */

:root {
    /* COLORS */
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary: #6610f2;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    /* BACKGROUNDS */
    --bg-body: #f5f7fb;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-hover: #eef4ff;
    /* TEXT */
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    /* BORDERS */
    --border-color: #e2e8f0;
    /* SHADOWS */
    --shadow-sm: 0 1px 4px rgba(0,0,0,.04);
    --shadow-md: 0 4px 14px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.08);
    /* RADII */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    /* LAYOUT */
    --sidebar-width: 250px;
    /* TRANSITION */
    --transition: all .25s ease;
}

/* =========================
   RESET
========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--bg-body);
    color: var(--text-dark);
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* =========================
   TYPOGRAPHY
========================= */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    color: var(--text-dark);
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.55rem;
}

h3 {
    font-size: 1.3rem;
}

h4 {
    font-size: 1.1rem;
}

h5 {
    font-size: 1rem;
}

p {
    color: var(--text-muted);
    margin-bottom: .5rem;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

/* =========================
   LAYOUT
========================= */

.portal-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

    .sidebar-brand h3 {
        color: white;
        font-size: 1.1rem;
        font-weight: 700;
    }

    .sidebar-brand p {
        color: rgba(255,255,255,.6);
        font-size: .78rem;
        margin-top: 4px;
    }

.sidebar-menu {
    padding: 10px 0;
}

.sidebar-menu-title {
    padding: 10px 18px;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255,255,255,.45);
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 10px;
    border-radius: 10px;
    color: rgba(255,255,255,.82);
    font-weight: 500;
    font-size: .92rem;
    transition: var(--transition);
}

    .sidebar-link i {
        font-size: .95rem;
        width: 18px;
    }

    .sidebar-link:hover {
        background: rgba(255,255,255,.06);
        color: white;
    }

    .sidebar-link.active {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
    }

/* =========================
   TOPBAR
========================= */

.topbar {
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(10px);
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-search {
    width: 260px;
    position: relative;
}

    .topbar-search input {
        width: 100%;
        height: 38px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 0 14px 0 38px;
        outline: none;
        font-size: .9rem;
    }

    .topbar-search i {
        position: absolute;
        left: 14px;
        top: 11px;
        color: var(--text-muted);
        font-size: .85rem;
    }

    .topbar-search input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(13,110,253,.08);
    }

/* =========================
   PAGE CONTENT
========================= */

.page-content {
    padding: 18px;
}

/* =========================
   CARDS
========================= */

.portal-card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid #edf2f7;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

    .portal-card:hover {
        box-shadow: var(--shadow-md);
    }

.portal-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: .95rem;
    font-weight: 700;
}

.portal-card-body {
    padding: 16px;
}

/* =========================
   STATS CARDS
========================= */

.stats-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    padding: 18px;
    color: white;
    min-height: 135px;
    transition: var(--transition);
}

    .stats-card:hover {
        transform: translateY(-2px);
    }

    .stats-card h2 {
        font-size: 1.7rem;
        font-weight: 800;
        color: white;
        margin-bottom: 6px;
    }

    .stats-card p {
        color: rgba(255,255,255,.82);
        font-size: .9rem;
    }

    .stats-card i {
        position: absolute;
        right: 16px;
        bottom: 16px;
        font-size: 2rem;
        opacity: .18;
    }

/* =========================
   TABLES
========================= */

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

    .table-modern thead th {
        padding: 12px 14px;
        font-size: .74rem;
        text-transform: uppercase;
        color: var(--text-muted);
        border-bottom: 1px solid var(--border-color);
        font-weight: 700;
    }

    .table-modern tbody td {
        padding: 12px 14px;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
        font-size: .9rem;
    }

    .table-modern tbody tr {
        transition: var(--transition);
    }

        .table-modern tbody tr:hover {
            background: var(--bg-hover);
        }

/* =========================
   BUTTONS
========================= */

.btn-primary-custom,
.btn-success-custom {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: .9rem;
    transition: var(--transition);
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-success-custom {
    background: linear-gradient(135deg, #20c997, #198754);
    color: white;
}

    .btn-primary-custom:hover,
    .btn-success-custom:hover {
        transform: translateY(-1px);
    }

/* =========================
   FORMS
========================= */

.form-control,
.form-select {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    font-size: .9rem;
    transition: var(--transition);
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(13,110,253,.08);
    }

.form-label {
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 6px;
}

/* =========================
   BADGES
========================= */

.badge-soft-success,
.badge-soft-danger,
.badge-soft-warning {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}

.badge-soft-success {
    background: rgba(25,135,84,.12);
    color: #198754;
}

.badge-soft-danger {
    background: rgba(220,53,69,.12);
    color: #dc3545;
}

.badge-soft-warning {
    background: rgba(255,193,7,.14);
    color: #c58a00;
}

/* =========================
   AVATAR
========================= */

.avatar,
.avatar-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 700;
}

.avatar {
    width: 42px;
    height: 42px;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: .82rem;
}

/* =========================
   PAGINATION
========================= */

.page-link {
    border: none;
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-dark);
    font-size: .85rem;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* =========================
   UTILITIES
========================= */

.rounded-md {
    border-radius: var(--radius-md);
}

.shadow-soft {
    box-shadow: var(--shadow-sm);
}

.text-muted-custom {
    color: var(--text-muted);
}

/* =========================
   GRADIENT UTILITIES
========================= */

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.bg-gradient-success {
    background: linear-gradient(135deg, #20c997, #198754);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #fd7e14, #ffc107);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ff4d6d, #dc3545);
}

/* =========================
   EXTRA UTILITIES
========================= */

.rounded-xl {
    border-radius: var(--radius-md);
}

.rounded-xxl {
    border-radius: var(--radius-lg);
}

.text-muted-custom {
    color: var(--text-muted);
}

.shadow-soft {
    box-shadow: var(--shadow-md);
}
/* =========================
   SIDEBAR BACKDROP
========================= */

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}
/* =========================
   SIDEBAR CLOSE BUTTON
========================= */

.sidebar-close-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}
/* =========================
   MOBILE
========================= */

@media(max-width: 992px) {

    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .topbar-search {
        display: none;
    }
}

@media(max-width: 768px) {

    .page-content {
        padding: 14px;
    }

    .portal-card-header,
    .portal-card-body {
        padding: 14px;
    }

    .stats-card {
        min-height: auto;
    }

        .stats-card h2 {
            font-size: 1.4rem;
        }

    .table-modern {
        min-width: 700px;
    }
}

/* =========================
   ACCESSIBILITY
========================= */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    * {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================
   MODULE CARDS
========================= */

.module-card {
    position: relative;
    border: 1px solid #edf2f7;
    border-radius: var(--radius-md);
    transition: var(--transition);
    overflow: hidden;
}

    .module-card:hover {
        border-color: rgba(13,110,253,.15);
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.module-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* =========================
   PAGE HEADER
========================= */

.page-header {
    margin-bottom: 18px;
}

.page-title {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 0;
}

/* =========================
   BRAND LOGO
========================= */

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
}

/* =========================
   USER PROFILE
========================= */

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user-info h6 {
    font-size: .88rem;
    margin-bottom: 2px;
}

.topbar-user-info p {
    font-size: .76rem;
    margin-bottom: 0;
}

/* =========================
   ALERTS
========================= */

.alert-modern {
    border: none;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    font-size: .9rem;
}

/* =========================
   MODALS
========================= */

.modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 14px 18px;
    border-bottom: none;
}

.modal-body {
    padding: 18px;
}

.modal-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border-color);
}

/* =========================
   FOOTER
========================= */

.portal-footer {
    margin-top: auto;
    padding: 14px;
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted);
}

/* =========================
   TIMELINE
========================= */

.timeline {
    position: relative;
    padding-left: 24px;
}

    .timeline::before {
        content: "";
        position: absolute;
        left: 7px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--border-color);
    }

.timeline-item {
    position: relative;
    margin-bottom: 16px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    position: absolute;
    left: -22px;
    top: 6px;
}

.timeline-content {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}

/* =========================
   TENANT SWITCHER
========================= */

.tenant-switcher {
    margin: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
}

    .tenant-switcher select {
        width: 100%;
        border: none;
        background: transparent;
        color: white;
        outline: none;
        font-size: .88rem;
    }

/* =========================
   PROFILE PAGE
========================= */

.profile-page {
    max-width: 1100px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 74px;
    height: 74px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    box-shadow: var(--shadow-md);
}

.profile-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.profile-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: .9rem;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(13,110,253,.08);
    color: var(--primary);
    font-weight: 600;
    font-size: .82rem;
}

.profile-input {
    height: 42px;
    border-radius: 10px !important;
    border: 1px solid #dbe4f0;
    background: #fbfcfe;
    padding-inline: 14px;
    font-size: .9rem;
    transition: var(--transition);
}

    .profile-input:focus {
        background: white;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(13,110,253,.08);
    }

/* =========================
   ERROR PAGE
========================= */

.error-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-card {
    width: 100%;
    max-width: 540px;
    background: white;
    border-radius: 18px;
    padding: 36px 28px;
    text-align: center;
    border: 1px solid #eef2f7;
    box-shadow: var(--shadow-md);
}

.error-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 18px;
    background: rgba(13,110,253,.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .error-icon i {
        font-size: 30px;
        color: var(--primary);
    }

.error-code {
    font-size: 4rem;
    line-height: 1;
    font-weight: 800;
    margin-bottom: 10px;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.error-message {
    max-width: 420px;
    margin: 0 auto 20px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* =========================
   TABLE RESPONSIVE
========================= */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* =========================
   FORM GROUPS
========================= */

.form-group {
    margin-bottom: 14px;
}

/* =========================
   GRID SPACING
========================= */

.row-tight {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
}

/* =========================
   COMPACT LIST GROUP
========================= */

.list-group-compact .list-group-item {
    padding: 10px 14px;
    font-size: .9rem;
    border-color: #edf2f7;
}

/* =========================
   DROPDOWNS
========================= */

.dropdown-menu {
    border: 1px solid #edf2f7;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 8px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .9rem;
}

    .dropdown-item:hover {
        background: var(--bg-hover);
    }

/* =========================
   NAV TABS
========================= */

.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

    .nav-tabs .nav-link {
        border: none;
        color: var(--text-muted);
        padding: 10px 14px;
        font-weight: 600;
        border-radius: 10px 10px 0 0;
        font-size: .9rem;
    }

        .nav-tabs .nav-link.active {
            background: white;
            color: var(--primary);
            border-bottom: 2px solid var(--primary);
        }

/* =========================
   ACCORDION
========================= */

.accordion-item {
    border: 1px solid #edf2f7;
    border-radius: 12px !important;
    overflow: hidden;
    margin-bottom: 10px;
}

.accordion-button {
    padding: 14px 16px;
    font-size: .92rem;
    font-weight: 600;
    background: white;
}

    .accordion-button:not(.collapsed) {
        background: rgba(13,110,253,.04);
        color: var(--primary);
        box-shadow: none;
    }

.accordion-body {
    padding: 16px;
}

/* =========================
   SKELETON LOADER
========================= */

.skeleton {
    position: relative;
    overflow: hidden;
    background: #edf2f7;
}

    .skeleton::after {
        content: "";
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        background: linear-gradient( 90deg, transparent, rgba(255,255,255,.5), transparent );
        animation: shimmer 1.2s infinite;
    }

@keyframes shimmer {

    100% {
        transform: translateX(100%);
    }
}

/* =========================
   EMPTY STATES
========================= */

.empty-state {
    text-align: center;
    padding: 36px 20px;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(13,110,253,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

    .empty-state-icon i {
        font-size: 28px;
        color: var(--primary);
    }

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--text-muted);
    max-width: 420px;
    margin: 0 auto;
}

/* =========================
   MOBILE
========================= */

@media(max-width:768px) {

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-avatar {
        width: 62px;
        height: 62px;
        font-size: 1.3rem;
    }

    .profile-title {
        font-size: 1.3rem;
    }

    .error-card {
        padding: 28px 20px;
    }

    .error-code {
        font-size: 3rem;
    }

    .page-title {
        font-size: 1.3rem;
    }
}