/* ============================================
   TIMOLOGISI ERP - SITE.CSS (v2.0 Modern Theme)
   Uses centralized CSS variables from theme.css
   REVERT: Replace with site.css.bak
   ============================================ */

html, body {
    font-family: var(--t-font-family);
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--t-body-bg);
    color: var(--t-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ---- TOP BAR / HEADER (Light with Brand Accent) ---- */
.top-bar, .app-header {
    background-color: var(--t-header-bg);
    color: var(--t-header-text);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 2px solid var(--t-header-border);
    box-shadow: var(--t-header-shadow);
    z-index: 10;
}

.logo, .app-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--t-primary);
}

.date-user, .user-info {
    font-size: 13px;
    display: flex;
    align-items: center;
    color: var(--t-header-text);
    gap: 15px;
}

.date-user i, .user-info i {
    margin-right: 6px;
    color: var(--t-secondary);
}

/* ---- MAIN LAYOUT ---- */
.main-container, .app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---- SIDEBAR (Light Modern) ---- */
.sidebar {
    width: var(--t-sidebar-width);
    background-color: var(--t-sidebar-bg);
    border-right: 1px solid var(--t-sidebar-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header, .sidebar-title {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--t-sidebar-border);
    color: var(--t-secondary);
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: none;
    margin: 1px 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    color: var(--t-sidebar-text) !important;
    font-weight: 400;
    text-decoration: none;
    padding: 9px 12px;
    transition: all var(--t-transition-fast);
    font-size: 13px;
    border-radius: 6px;
}

.sidebar-menu a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--t-sidebar-icon);
}

.sidebar-menu a:hover {
    background-color: var(--t-sidebar-hover) !important;
    color: var(--t-primary) !important;
}

.sidebar-menu a.active {
    background-color: var(--t-sidebar-active-bg) !important;
    color: var(--t-sidebar-active-text) !important;
    font-weight: 500;
}

.sidebar-menu a.active i {
    color: var(--t-sidebar-active-text);
}

/* v3.42: Sidebar hide/show toggle */
.sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-hide-btn {
    background: transparent;
    border: none;
    color: var(--t-sidebar-icon);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.6;
    transition: all var(--t-transition-fast);
}
.sidebar-hide-btn:hover {
    opacity: 1;
    background: var(--t-sidebar-hover);
    color: var(--t-secondary);
}

/* v3.43: Mini sidebar (collapsed mode with icons) */
.sidebar-mini {
    width: 60px;
    background-color: var(--t-sidebar-bg);
    border-right: 1px solid var(--t-sidebar-border);
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}
.sidebar-mini-expand {
    padding: 14px 0;
    text-align: center;
    border-bottom: 1px solid var(--t-sidebar-border);
}
.sidebar-expand-btn {
    background: transparent;
    border: none;
    color: var(--t-sidebar-icon);
    cursor: pointer;
    font-size: 16px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all var(--t-transition-fast);
}
.sidebar-expand-btn:hover {
    background: var(--t-sidebar-hover);
    color: var(--t-secondary);
    transform: scale(1.1);
}
.sidebar-mini-menu {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    flex: 1;
}
.sidebar-mini-menu li {
    margin: 1px 0;
}
.sidebar-mini-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t-sidebar-text);
    text-decoration: none;
    padding: 10px 0;
    transition: all var(--t-transition-fast);
    position: relative;
}
.sidebar-mini-menu a i {
    font-size: 16px;
    color: var(--t-sidebar-icon);
    width: 20px;
    text-align: center;
}
.sidebar-mini-menu a:hover {
    background-color: var(--t-sidebar-hover);
}
.sidebar-mini-menu a:hover i {
    color: var(--t-primary);
}
.sidebar-mini-menu a.active {
    background-color: var(--t-sidebar-active-bg);
}
.sidebar-mini-menu a.active i {
    color: var(--t-sidebar-active-text);
}
/* Mini sidebar uses native title tooltips (CSS ::after clipped by overflow:hidden on parent containers) */

/* Nav menu (alternative) */
.nav-menu {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 8px 0;
}

.nav-item {
    border-bottom: none;
    list-style: none;
    margin: 1px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--t-sidebar-text) !important;
    font-weight: 400;
    text-decoration: none;
    padding: 9px 12px;
    transition: all var(--t-transition-fast);
    font-size: 13px;
    border-radius: 6px;
}

.nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--t-sidebar-icon);
}

.nav-link:hover {
    background-color: var(--t-sidebar-hover) !important;
    color: var(--t-primary) !important;
}

.nav-link.active {
    background-color: var(--t-sidebar-active-bg) !important;
    color: var(--t-sidebar-active-text) !important;
    font-weight: 500;
}

/* ---- CONTENT AREA ---- */
.content-area, .dashboard-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--t-page-bg);
}

/* ---- DASHBOARD CARDS ---- */
.dashboard-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dashboard-card, .card {
    flex: 1;
    min-width: 250px;
    background-color: var(--t-card-bg);
    border-radius: var(--t-card-radius);
    box-shadow: var(--t-card-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--t-card-border);
}

.card-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--t-border);
    background-color: var(--t-card-header-bg);
    border-radius: var(--t-card-radius) var(--t-card-radius) 0 0;
}

.card-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0;
    color: var(--t-text-primary);
}

.card-body {
    padding: 16px;
}

/* Disabled fieldset: show normal cursor on container, not-allowed only on inputs */
fieldset[disabled] {
    cursor: default;
}
fieldset[disabled] .form-control,
fieldset[disabled] .form-select {
    cursor: not-allowed;
}

.amount-display {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    padding: 10px 0;
    color: var(--t-text-primary);
}

/* ---- TABLES ---- */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    background-color: var(--t-table-header-bg);
    padding: 10px 12px;
    border-bottom: 1px solid var(--t-table-border);
    font-weight: 500;
    font-size: 13px;
    color: var(--t-table-header-text);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--t-border-light);
    font-size: 13px;
    color: var(--t-text-primary);
}

/* ---- BLAZOR ERROR UI ---- */
#blazor-error-ui {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ---- RESPONSIVE / OFFCANVAS ---- */
.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--t-primary);
    font-size: 22px;
    padding: 8px 12px;
    margin-right: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: var(--t-primary-light);
    border-radius: 6px;
}

.sidebar-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--t-primary-rgb), 0.3);
}

/* Offcanvas sidebar */
.offcanvas.offcanvas-start {
    width: var(--t-sidebar-width);
    background-color: var(--t-sidebar-bg);
}

.offcanvas-header {
    background-color: var(--t-header-bg);
    color: var(--t-header-text);
    padding: 15px;
    border-bottom: 1px solid var(--t-border);
}

.offcanvas-title {
    font-weight: 600;
    color: var(--t-primary);
    margin: 0;
}

.offcanvas-header .btn-close {
    filter: none;
}

.offcanvas-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.offcanvas-body .sidebar-menu {
    background-color: var(--t-sidebar-bg);
    flex: 1;
}

.offcanvas-body .sidebar-version {
    margin-top: auto;
}

/* Sidebar version */
.sidebar-version {
    margin-top: auto;
    padding: 12px 16px;
    text-align: center;
    color: var(--t-text-muted);
    font-size: 12px;
    border-top: 1px solid var(--t-border);
    background-color: var(--t-sidebar-bg);
}

/* ---- FORM CONTROLS (Global) ---- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="search"],
input[type="url"],
textarea,
select,
.form-control,
.form-select {
    font-family: var(--t-font-family);
    border: 1px solid var(--t-input-border);
    border-radius: var(--t-input-radius);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--t-input-text);
    background-color: var(--t-input-bg);
    transition: border-color var(--t-transition-fast), box-shadow var(--t-transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--t-input-focus-border);
    box-shadow: var(--t-input-focus-shadow);
}

input:disabled,
textarea:disabled,
select:disabled,
.form-control:disabled {
    background-color: var(--t-input-disabled-bg);
    cursor: not-allowed;
}

/* ---- BUTTONS ---- */
.btn-primary {
    background-color: var(--t-btn-primary-bg);
    border-color: var(--t-btn-primary-bg);
    color: var(--t-btn-primary-text);
    border-radius: var(--t-btn-radius);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 16px;
    transition: all var(--t-transition-fast);
}

.btn-primary:hover {
    background-color: var(--t-btn-primary-hover);
    border-color: var(--t-btn-primary-hover);
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 991.98px) {
    .app-header {
        padding: 0 10px;
    }

    .app-header .app-title {
        flex: 1;
    }

    .app-header .app-title img {
        height: 32px !important;
    }

    .app-header .app-title span {
        display: none;
    }

    .user-info {
        font-size: 12px;
    }

    .user-info .fa-calendar-alt,
    .user-info #current-datetime,
    .user-info .fa-building,
    .user-info > span:has(.fa-building) {
        display: none;
    }

    .user-info a[href="/change-password"] span,
    .user-info button span {
        display: none;
    }

    .dashboard-container {
        padding: 10px;
    }
}

@media (max-width: 991.98px) {
    .app-content {
        flex-direction: column;
    }

    .dashboard-container {
        width: 100%;
    }
}

/* =========================================================================
   v3.17: Global Search (Ctrl+K) Styles
   ========================================================================= */
.global-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    z-index: 9999;
    animation: gsOverlayIn 0.15s ease-out;
}

@keyframes gsOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.global-search-modal {
    background: var(--t-card-bg, #fff);
    border: 1px solid var(--t-border, #dee2e6);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    width: 92%;
    max-width: 620px;
    max-height: 65vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gsModalIn 0.15s ease-out;
}

@keyframes gsModalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.global-search-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--t-border, #dee2e6);
    gap: 10px;
}

.global-search-header > i.fa-search {
    color: var(--t-text-secondary, #6c757d);
    font-size: 16px;
    flex-shrink: 0;
}

.global-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--t-text-primary, #212529);
    outline: none;
    min-width: 0;
}

.global-search-input::placeholder {
    color: var(--t-text-secondary, #adb5bd);
}

.global-search-shortcut kbd {
    background: var(--t-input-bg, #f8f9fa);
    border: 1px solid var(--t-border, #dee2e6);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-family: inherit;
    color: var(--t-text-secondary, #6c757d);
}

.global-search-results {
    overflow-y: auto;
    padding: 6px;
    max-height: calc(65vh - 120px);
}

.search-category {
    margin-bottom: 4px;
}

.search-category-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--t-text-secondary, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--t-hover-bg, #f0f6ff);
}

.search-result-item > i:first-child {
    font-size: 16px;
    color: var(--t-primary, #22B2A8);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--t-text-primary, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-subtitle {
    font-size: 12px;
    color: var(--t-text-secondary, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-arrow {
    color: var(--t-text-secondary, #adb5bd);
    font-size: 11px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s;
}

.search-result-item:hover .search-result-arrow,
.search-result-item.selected .search-result-arrow {
    opacity: 1;
}

.global-search-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    color: var(--t-text-secondary, #6c757d);
    font-size: 13px;
}

.global-search-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--t-border, #dee2e6);
    font-size: 11px;
    color: var(--t-text-secondary, #6c757d);
}

.global-search-footer kbd {
    background: var(--t-input-bg, #f8f9fa);
    border: 1px solid var(--t-border, #dee2e6);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: inherit;
    margin-right: 3px;
}

/* v3.19: Keyboard Shortcut Help Modal */
.kb-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 9999;
    animation: gsOverlayIn 0.15s ease-out;
}

.kb-help-modal {
    background: var(--t-card-bg, #fff);
    border: 1px solid var(--t-border, #dee2e6);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    width: 92%;
    max-width: 520px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gsModalIn 0.15s ease-out;
}

.kb-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--t-border, #dee2e6);
}

.kb-help-body {
    padding: 12px 18px;
    overflow-y: auto;
    flex: 1;
}

.kb-help-section {
    margin-bottom: 16px;
}

.kb-help-section:last-child {
    margin-bottom: 4px;
}

.kb-help-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--t-text-secondary, #6c757d);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--t-border, #eee);
}

.kb-help-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.kb-help-row kbd {
    background: var(--t-input-bg, #f8f9fa);
    color: var(--t-text-primary, #333);
    border: 1px solid var(--t-border, #dee2e6);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-family: inherit;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.kb-help-row span {
    font-size: 13px;
    color: var(--t-text-primary, #333);
}

.kb-help-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-top: 1px solid var(--t-border, #dee2e6);
}

.kb-help-footer kbd {
    background: var(--t-input-bg, #f8f9fa);
    color: var(--t-text-primary, #333);
    border: 1px solid var(--t-border, #dee2e6);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: inherit;
    margin: 0 2px;
}

/* v3.20: Notification Bell */
.notif-bell-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
}

.notif-bell-btn {
    background: none;
    border: none;
    color: var(--t-header-text, #fff);
    font-size: 16px;
    cursor: pointer;
    padding: 5px 8px;
    position: relative;
    transition: opacity 0.15s;
}

.notif-bell-btn:hover {
    opacity: 0.8;
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -60px;
    width: 380px;
    max-height: 480px;
    background: var(--t-card-bg, #fff);
    border: 1px solid var(--t-border, #dee2e6);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gsModalIn 0.15s ease-out;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--t-border, #dee2e6);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--t-primary, #22B2A8);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.notif-mark-all:hover {
    background: rgba(34, 178, 168, 0.1);
}

.notif-dropdown-body {
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--t-text-secondary, #6c757d);
    font-size: 13px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--t-border, #f0f0f0);
    transition: background 0.15s;
    position: relative;
}

.notif-item:hover {
    background: var(--t-row-hover, #f8f9fa);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-unread {
    background: rgba(34, 178, 168, 0.04);
}

.notif-item-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    font-size: 14px;
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--t-text-primary, #333);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-message {
    font-size: 12px;
    color: var(--t-text-secondary, #6c757d);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item-time {
    font-size: 11px;
    color: var(--t-text-secondary, #999);
    margin-top: 4px;
}

.notif-item-time i {
    margin-right: 3px;
}

.notif-item-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--t-primary, #22B2A8);
    border-radius: 50%;
    margin-top: 8px;
}

@media (max-width: 576px) {
    .notif-dropdown {
        width: 300px;
        right: -20px;
    }
}

/* Header search button */
.header-search-btn {
    background: transparent;
    border: 1px solid var(--t-border, rgba(255,255,255,0.3));
    color: var(--t-header-text, #fff);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s;
    margin-right: 12px;
}

.header-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-search-btn kbd {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: inherit;
    color: inherit;
}
