/* Bidanara-Care CSS Design System */
:root {
    --font-sans: 'Inter', sans-serif;
    
    /* Premium Color Palette (Violet & Pink Theme) */
    --color-bg-page: #f6f8fc;
    --color-sidebar: #7c3aed; /* Bidanara-Care Violet */
    --color-sidebar-hover: rgba(255, 255, 255, 0.1);
    --color-sidebar-active: rgba(255, 255, 255, 0.2);
    --color-sidebar-text: #f5f3ff;
    --color-sidebar-text-active: #ffffff;
    
    --color-header: #ffffff;
    --color-text-main: #1f1f1f;
    --color-text-muted: #5f6368;
    
    /* Accent Colors */
    --color-primary: #7c3aed;
    --color-success: #0f9d58;
    --color-warning: #f4b400;
    --color-danger: #d93025;
    --color-info: #007b83;
    
    /* Layout Dimensions */
    --sidebar-width: 280px;
    --header-height: 64px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-page);
    color: var(--color-text-main);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout Wrapper */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-body {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
    min-height: 0;
    position: relative;
    background-color: var(--color-bg-page);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-sidebar);
    color: #ffffff;
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    border-top-right-radius: 40px; /* Crucial Google Drive aesthetic */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition-normal);
}

/* Sidebar action button container (Pendaftaran Baru) */
.sidebar-action-container {
    padding: 24px 20px 12px 20px;
}

.sidebar-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #ffffff;
    color: var(--color-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    transition: box-shadow var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

.sidebar-action-btn:hover {
    background-color: #f8fafc;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 12px 4px rgba(60,64,67,0.2);
    transform: translateY(-1px);
}

.sidebar-action-btn i {
    font-size: 18px;
}

.sidebar-menu-wrapper {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.sidebar-menu-wrapper::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.menu-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    padding-left: 20px;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item > a, .menu-item > .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-radius: 24px;
    color: var(--color-sidebar-text);
    font-size: 15.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.menu-link-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-link-content i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-item > a:hover, .menu-item > .menu-toggle:hover {
    background-color: var(--color-sidebar-hover);
    color: #ffffff;
}

.menu-item.active > a, .menu-item.active > .menu-toggle {
    background-color: var(--color-sidebar-active);
    color: var(--color-sidebar-text-active);
    font-weight: 600;
}

.menu-item.active > a i, .menu-item.active > .menu-toggle i {
    color: var(--color-sidebar-text-active);
}

.menu-arrow {
    font-size: 10px !important;
    transition: transform var(--transition-fast);
}

.menu-item.open .menu-arrow {
    transform: rotate(180deg);
}

/* Submenu dropdown */
.submenu {
    list-style: none;
    padding-left: 24px;
    margin-top: 4px;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.menu-item.open .submenu {
    display: flex;
}

.submenu-link {
    display: block;
    padding: 8px 16px;
    font-size: 14.5px;
    color: #f5f3ff;
    border-radius: 18px;
    transition: var(--transition-fast);
}

.submenu-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.submenu-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* Storage / Capacity details card at the bottom */
.sidebar-storage-card {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    font-size: 13px;
    color: #e8f0fe;
}

.sidebar-storage-card .storage-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #c2e7ff;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-storage-item {
    margin-bottom: 12px;
}

.sidebar-storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 4px;
    color: #e8f0fe;
}

.sidebar-storage-info .storage-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-storage-progress {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.sidebar-storage-bar {
    height: 100%;
    background-color: #ffffff;
    border-radius: 2px;
}

.sidebar-storage-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #c2e7ff;
    text-decoration: none;
    margin-top: 4px;
    font-size: 12px;
    transition: color var(--transition-fast);
}

.sidebar-storage-upgrade:hover {
    color: #ffffff;
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--transition-normal);
    background-color: var(--color-bg-page);
}

/* Header Styling */
.header {
    height: var(--header-height);
    background-color: var(--color-header);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 110;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--color-primary);
    text-decoration: none;
}

.hamburger-btn {
    font-size: 20px;
    background: none;
    border: none;
    color: var(--color-text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    background-color: #f1f5f9;
}

/* Header Search Bar */
.header-search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 32px;
}

.header-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--color-text-muted);
    font-size: 15px;
}

.header-search-input {
    width: 100%;
    padding: 11px 16px 11px 48px;
    border: none;
    background-color: #f1f3f4;
    border-radius: 24px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    color: var(--color-text-main);
    transition: var(--transition-fast);
}

.header-search-input:focus {
    outline: none;
    background-color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

/* Header User Profile & Quick Icons */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-utility-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.header-utility-btn:hover {
    background-color: #f1f5f9;
    color: var(--color-text-main);
}

.user-profile-dropdown {
    position: relative;
    margin-left: 8px;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 24px;
    transition: var(--transition-fast);
}

.user-profile-btn:hover {
    background-color: #f1f5f9;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-main);
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px 0 2px;
}

.user-profile-btn i {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-right: 4px;
}

/* Dashboard Content Grid */
.content-body {
    padding: 30px;
    flex: 1;
}

/* Stats Row Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.stat-card.blue { border-left: 4px solid var(--color-primary); }
.stat-card.green { border-left: 4px solid var(--color-success); }
.stat-card.orange { border-left: 4px solid var(--color-warning); }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--color-text-muted);
}

.stat-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 18px;
}

.stat-value-container {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-main);
}

.stat-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* Specific styling for Kas Bersih */
.stat-sub-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
}

.sub-income {
    color: var(--color-success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sub-expense {
    color: var(--color-danger);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dashboard Main Grid - Two Columns Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

/* Tables Card Container */
.table-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
}

.table-card-header.red {
    background-color: var(--color-danger);
}

.table-card-header.gold {
    background-color: var(--color-warning);
    color: #1e293b;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 380px;
    position: relative;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.premium-table th {
    background-color: #f8fafc;
    color: var(--color-text-main);
    font-weight: 700;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.premium-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.premium-table tr:hover {
    background-color: #f8fafc;
}

.premium-table tr:last-child td {
    border-bottom: none;
}

/* Custom Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-align: center;
}

.badge.gray {
    background-color: #f1f5f9;
    color: #475569;
}

.badge.cyan {
    background-color: #eff6ff;
    color: var(--color-info);
}

.badge.purple {
    background-color: #faf5ff;
    color: #7c3aed;
}

.badge.date-badge {
    background-color: #eff6ff;
    color: var(--color-primary);
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 8px;
}

.circle-badge-danger {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--color-danger);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* Action Buttons */
.wa-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #25d366;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 14px;
}

.wa-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.patient-subtext {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Footer styling */
.footer {
    padding: 20px 30px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Responsive collapse classes */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.main-wrapper.expanded {
    margin-left: 0;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .sidebar.open {
        transform: translateX(0);
    }
}

/* Login Page Glassmorphism Styling */
.login-bg {
    background: #eff6f3;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.login-header-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    color: var(--color-sidebar);
    margin-bottom: 12px;
}

.login-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 30px;
}

.login-form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 6px;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.login-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--color-text-main);
    transition: var(--transition-fast);
}

.login-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background-color: #ffffff;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--color-sidebar);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: 10px;
}

.login-btn:hover {
    background-color: #db2777;
    transform: translateY(-1px);
}

.login-error-alert {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--color-danger);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Profile Dropdown Panel */
.user-profile-dropdown {
    position: relative;
}

.profile-dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 8px 0;
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.profile-dropdown-panel.show {
    display: flex;
}

.profile-dropdown-header {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
}

.profile-dropdown-header strong {
    font-size: 14px;
    color: var(--color-text-main);
    font-weight: 700;
}

.profile-dropdown-header span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.profile-dropdown-divider {
    height: 1px;
    background-color: #f1f5f9;
    margin: 6px 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13.5px;
    color: #475569;
    transition: var(--transition-fast);
    cursor: pointer;
    text-align: left;
}

.profile-dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--color-danger);
}

.profile-dropdown-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Sidebar Footer & Logout Button */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffcccc;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 24px;
    transition: var(--transition-fast);
    width: 100%;
}

.sidebar-logout-btn i {
    font-size: 16px;
    color: #ff6b6b;
}

.sidebar-logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Bidanara-Care brand: supplied artwork is displayed unchanged. */
.header-logo{color:#075b60;letter-spacing:-.4px;white-space:nowrap;gap:10px}
.bidanara-brand-mark{display:block;position:relative;width:42px;height:44px;overflow:hidden;flex:none;background:white}
.bidanara-brand-mark img{position:absolute;width:84px;height:84px;max-width:none;left:-21px;top:-10px}
.login-bg{background:radial-gradient(ellipse at 15% 10%,#b9e4d8,transparent 60%),radial-gradient(ellipse at 95% 90%,#f3dfb7,transparent 55%),#eff6f3}
.login-card{background:#fffffff5;border:1px solid #d7e6df;box-shadow:0 18px 60px #13484214}
.bidanara-login-logo{display:block;width:240px;max-width:100%;height:auto}
.login-header-logo{color:#086c64}
.login-btn{background:#087c72}.login-btn:hover{background:#065d59}
.login-input:focus{border-color:#087c72;box-shadow:0 0 0 3px #087c721c}
@media(max-width:600px){.header{padding-left:12px;padding-right:12px}.header-left{gap:6px}.header-logo{font-size:18px;gap:6px}.header-search-container{display:none}.header-right{gap:4px}.header-utility-btn{display:none}.user-name{display:none}.login-card{padding:28px 22px}}
