/* --------------------------------------------------------------------------
   Apple-like System Stylesheet (macOS / iOS HIG Aesthetic)
   -------------------------------------------------------------------------- */

:root {
    --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --apple-bg: #f5f5f7;
    --apple-card-solid: #ffffff;
    --apple-text-primary: #1d1d1f;
    --apple-text-secondary: #86868b;
    --apple-border: rgba(0, 0, 0, 0.08);
    --apple-border-strong: rgba(0, 0, 0, 0.12);
    
    /* Apple System Colors */
    --apple-blue: #007aff;
    --apple-blue-hover: #0062cc;
    --apple-green: #34c759;
    --apple-green-hover: #2db34f;
    --apple-red: #ff3b30;
    --apple-red-hover: #e03228;
    --apple-purple: #af52de;
    --apple-purple-hover: #9a42c8;
    --apple-orange: #ff9500;
    --apple-gray-light: #f2f2f7;
    --apple-gray-hover: #e5e5ea;

    /* Shadows & Effects */
    --apple-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --apple-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
    --apple-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* Base Body Styles */
body {
    font-family: var(--apple-font) !important;
    background-color: var(--apple-bg) !important;
    color: var(--apple-text-primary) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings & Typography */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--apple-font) !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    color: var(--apple-text-primary) !important;
}

/* Navbar Topbar Header (Frosted Glass Effect) */
.navbar-custom {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--apple-border) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03) !important;
    height: 70px !important;
}

.logo-box {
    background-color: transparent !important;
    border-bottom: 1px solid var(--apple-border) !important;
    height: 70px !important;
    line-height: 70px !important;
}

.logo-lg-text-light {
    color: var(--apple-text-primary) !important;
    font-weight: 700 !important;
    font-size: 17px !important;
    letter-spacing: -0.03em !important;
}

/* Search Box in Header */
.navbar-custom .app-search {
    padding-top: 15px !important;
}

.navbar-custom .app-search .form-control {
    border-radius: 10px 0 0 10px !important;
    background: rgba(238, 238, 242, 0.8) !important;
    border: 1px solid var(--apple-border) !important;
    height: 38px !important;
    font-size: 14px !important;
}

.navbar-custom .app-search .btn {
    border-radius: 0 10px 10px 0 !important;
    background: var(--apple-blue) !important;
    border: none !important;
    height: 38px !important;
    font-weight: 500 !important;
}

/* Sidebar Menu - Dark Navy Blue Theme */
.left-side-menu {
    background: #0f172a !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 2px 0 16px rgba(15, 23, 42, 0.25) !important;
    top: 70px !important;
}

#sidebar-menu {
    background: transparent !important;
}

#sidebar-menu > ul > li > a {
    border-radius: 10px !important;
    margin: 4px 12px !important;
    padding: 10px 14px !important;
    color: #e2e8f0 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    transition: all 0.18s ease-in-out !important;
}

#sidebar-menu > ul > li > a i {
    color: #94a3b8 !important;
    transition: color 0.18s ease !important;
}

#sidebar-menu > ul > li > a:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

#sidebar-menu > ul > li > a:hover i {
    color: #ffffff !important;
}

#sidebar-menu > ul > li > a.active {
    background-color: #007aff !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35) !important;
}

#sidebar-menu > ul > li > a.active i {
    color: #ffffff !important;
}

#sidebar-menu .menu-title {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #64748b !important;
    font-weight: 600 !important;
    padding: 16px 20px 6px !important;
}

/* Second level menu links */
.nav-second-level {
    background: transparent !important;
}

.nav-second-level li a {
    border-radius: 8px !important;
    margin: 2px 14px 2px 28px !important;
    padding: 8px 12px !important;
    font-size: 13.5px !important;
    color: #94a3b8 !important;
    transition: all 0.18s ease-in-out !important;
}

.nav-second-level li a:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
}

.nav-second-level li a.active {
    color: #38bdf8 !important;
    font-weight: 600 !important;
}

.menu-arrow {
    color: #64748b !important;
}

/* Cards & Card-Box Container */
.card-box {
    background: var(--apple-card-solid) !important;
    border-radius: 16px !important;
    border: 1px solid var(--apple-border) !important;
    box-shadow: var(--apple-shadow-md) !important;
    padding: 24px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    margin-bottom: 24px !important;
}

.card {
    background: var(--apple-card-solid) !important;
    border-radius: 16px !important;
    border: 1px solid var(--apple-border) !important;
    box-shadow: var(--apple-shadow-md) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    margin-bottom: 24px !important;
}

.card-body {
    padding: 24px !important;
}

.card-box:hover {
    box-shadow: var(--apple-shadow-lg) !important;
}

/* Dedicated Login Card Styling */
.login-card {
    border-radius: 20px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid var(--apple-border) !important;
    background: #ffffff !important;
    overflow: hidden !important;
}

.login-header {
    background: linear-gradient(180deg, #f2f5f9 0%, #e8eef5 100%) !important;
    padding: 28px 24px 22px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    text-align: center !important;
}

.login-body {
    padding: 28px 28px 32px !important;
}

.content-page {
    margin-top: 70px !important;
}

/* Form Controls & Inputs */
.form-control, .form-select, select.form-control {
    border-radius: 10px !important;
    border: 1px solid var(--apple-border-strong) !important;
    background-color: #ffffff !important;
    padding: 9px 14px !important;
    font-size: 14px !important;
    color: var(--apple-text-primary) !important;
    transition: all 0.2s ease-in-out !important;
}

.form-control:focus, .form-select:focus, select.form-control:focus {
    border-color: var(--apple-blue) !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15) !important;
    outline: none !important;
}

/* Buttons (Apple Style Controls) */
.btn {
    border-radius: 10px !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    transition: all 0.18s ease-in-out !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.btn-primary {
    background-color: var(--apple-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.25) !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--apple-blue-hover) !important;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35) !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: var(--apple-green) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.25) !important;
}

.btn-success:hover, .btn-success:focus {
    background-color: var(--apple-green-hover) !important;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.35) !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: var(--apple-red) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.25) !important;
}

.btn-danger:hover, .btn-danger:focus {
    background-color: var(--apple-red-hover) !important;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.35) !important;
    color: #ffffff !important;
}

.btn-purple, .btn-info {
    background-color: var(--apple-purple) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(175, 82, 222, 0.25) !important;
}

.btn-purple:hover, .btn-info:hover {
    background-color: var(--apple-purple-hover) !important;
    color: #ffffff !important;
}

.btn-secondary, .btn-light {
    background-color: var(--apple-gray-light) !important;
    color: var(--apple-text-primary) !important;
}

.btn-secondary:hover, .btn-light:hover {
    background-color: var(--apple-gray-hover) !important;
}

.btn-sm {
    padding: 5px 10px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
}

/* Modern Tables */
.table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    border: 1px solid var(--apple-border) !important;
    background: #ffffff !important;
    margin-bottom: 20px !important;
}

.table th {
    background-color: rgba(242, 242, 247, 0.8) !important;
    color: var(--apple-text-secondary) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 11.5px !important;
    letter-spacing: 0.05em !important;
    border-bottom: 1px solid var(--apple-border) !important;
    padding: 14px 16px !important;
}

.table td {
    padding: 14px 16px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    vertical-align: middle !important;
    color: var(--apple-text-primary) !important;
    font-size: 14px !important;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(245, 245, 247, 0.4) !important;
}

.table tbody tr:hover {
    background-color: rgba(0, 122, 255, 0.03) !important;
}

/* Badges & Alerts */
.badge {
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    letter-spacing: 0.02em !important;
}

.badge.bg-primary {
    background-color: var(--apple-blue) !important;
    color: #ffffff !important;
}

.alert {
    border-radius: 12px !important;
    border: none !important;
    padding: 14px 18px !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.15) !important;
    color: #1e7032 !important;
}

.alert-danger {
    background-color: rgba(255, 59, 48, 0.15) !important;
    color: #a82018 !important;
}

/* Income & Expenses Day Detail Containers */
.theincome {
    background-color: rgba(52, 199, 89, 0.06) !important;
    border: 1px solid rgba(52, 199, 89, 0.25) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: var(--apple-shadow-sm) !important;
}

.theincome h5 {
    color: #1e7032 !important;
    font-weight: 600 !important;
    margin-bottom: 16px !important;
}

.theexpenses {
    background-color: rgba(255, 59, 48, 0.06) !important;
    border: 1px solid rgba(255, 59, 48, 0.25) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: var(--apple-shadow-sm) !important;
}

.theexpenses h5 {
    color: #a82018 !important;
    font-weight: 600 !important;
    margin-bottom: 16px !important;
}

/* Modals */
.modal-content {
    border-radius: 20px !important;
    border: 1px solid var(--apple-border) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
}

.modal-header {
    border-bottom: 1px solid var(--apple-border) !important;
    background-color: rgba(245, 245, 247, 0.6) !important;
    padding: 18px 24px !important;
}

.modal-footer {
    border-top: 1px solid var(--apple-border) !important;
    background-color: rgba(245, 245, 247, 0.6) !important;
    padding: 14px 24px !important;
}

/* Floating role button in bottom right */
.demos-show-btn {
    border-radius: 30px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    padding: 8px 18px !important;
    font-weight: 600 !important;
}

/* Calendar styling refinements */
.calendar {
    max-width: 100% !important;
    margin: auto !important;
}

.calendar th {
    padding: 12px 6px !important;
}

.calendar td {
    padding: 16px 8px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    transition: background-color 0.15s ease !important;
}

.calendar td.past-date:hover {
    background-color: rgba(0, 122, 255, 0.1) !important;
    cursor: pointer !important;
}

/* Animated Blurry Background for Login Page */
.login-bg-wrapper {
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    z-index: 0;
    overflow: hidden;
}

.login-bg-image {
    width: 100%;
    height: 100%;
    background-image: url('../images/login_bg.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(12px) brightness(0.88);
    transform: scale(1.08);
    animation: loginBgZoom 25s ease-in-out infinite alternate;
}

.login-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, rgba(245, 245, 247, 0.55) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@keyframes loginBgZoom {
    0% {
        transform: scale(1.08) translate(0, 0);
    }
    50% {
        transform: scale(1.15) translate(-1.5%, -1%);
    }
    100% {
        transform: scale(1.08) translate(1%, 1.5%);
    }
}

.login-card-glass {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
}

/* Subcategory Chip UI */
.subcat-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.subcat-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 122, 255, 0.07);
    color: #1d1d1f;
    border: 1px solid rgba(0, 122, 255, 0.15);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.subcat-chip:hover {
    background: rgba(0, 122, 255, 0.12);
    border-color: rgba(0, 122, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 122, 255, 0.1);
}

.subcat-chip .chip-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 6px;
    color: #86868b;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.subcat-chip .chip-action.edit:hover {
    background: rgba(0, 122, 255, 0.2);
    color: var(--apple-blue);
}

.subcat-chip .chip-action.delete:hover {
    background: rgba(255, 59, 48, 0.2);
    color: var(--apple-red);
}

.subcat-chip.add-chip {
    background: rgba(52, 199, 89, 0.08);
    color: #2db34f;
    border: 1px dashed rgba(52, 199, 89, 0.4);
    cursor: pointer;
}

.subcat-chip.add-chip:hover {
    background: rgba(52, 199, 89, 0.16);
    border-color: rgba(52, 199, 89, 0.6);
}

/* Category Badge ID */
.category-id-badge {
    background: var(--apple-gray-light);
    color: var(--apple-text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    margin-right: 8px;
}

/* Apple Buttons */
.btn-apple-primary {
    background: var(--apple-blue) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    padding: 9px 18px !important;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.25) !important;
    transition: all 0.2s ease !important;
}

.btn-apple-primary:hover {
    background: var(--apple-blue-hover) !important;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35) !important;
    transform: translateY(-1px) !important;
}

.btn-apple-success {
    background: var(--apple-green) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    padding: 9px 18px !important;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.25) !important;
    transition: all 0.2s ease !important;
}

.btn-apple-success:hover {
    background: var(--apple-green-hover) !important;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.35) !important;
    transform: translateY(-1px) !important;
}

.btn-apple-secondary {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--apple-text-primary) !important;
    border: 1px solid var(--apple-border) !important;
    border-radius: 10px !important;
    font-weight: 500 !important;
    padding: 6px 12px !important;
    transition: all 0.2s ease !important;
}

.btn-apple-secondary:hover {
    background: rgba(0, 0, 0, 0.09) !important;
}

.btn-apple-danger {
    background: rgba(255, 59, 48, 0.08) !important;
    color: var(--apple-red) !important;
    border: 1px solid rgba(255, 59, 48, 0.2) !important;
    border-radius: 10px !important;
    font-weight: 500 !important;
    padding: 6px 12px !important;
    transition: all 0.2s ease !important;
}

.btn-apple-danger:hover {
    background: var(--apple-red) !important;
    color: #ffffff !important;
}

/* Subcategory Vertical List UI */
.subcat-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 0;
}

.subcat-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 10px;
    transition: all 0.15s ease;
}

.subcat-item-row:hover {
    background: #ffffff;
    border-color: rgba(0, 122, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.06);
}



