/**
 * Payment Reminder System - Professional CSS
 * Modern, responsive, and clean design
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-gray: #f1f5f9;
    --medium-gray: #e2e8f0;
    --dark-gray: #475569;
    --white: #ffffff;
    --black: #0f172a;
    --text-color: #334155;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

/* Modern gradient animation */
.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20%, -20%); }
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--secondary-color);
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

.login-footer p {
    color: var(--secondary-color);
    font-size: 12px;
    margin-bottom: 8px;
}

.login-version {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary-color);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    background: var(--light-gray);
    border-radius: 12px;
    margin-top: 8px;
}

.login-version .version-icon {
    font-size: 12px;
}

/* ===== Main Layout ===== */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   MODERN SIDEBAR STYLES
   ======================================== */

/* HIDE SIDEBAR - Moved to Header Navigation */
.sidebar {
    display: none !important;
}

.sidebar-header {
    padding: 24px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 3px solid #5568d3;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-icon {
    font-size: 24px;
}

/* Sidebar Navigation */
nav {
    padding: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a span {
    font-size: 20px;
    min-width: 24px;
    text-align: center;
}

.sidebar-menu a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Active menu item */
.sidebar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #ffffff;
    border-radius: 0 4px 4px 0;
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sidebar-menu a svg,
.sidebar-menu a i {
    margin-right: 10px;
    width: 20px;
}

/* ===== Sidebar Activity Widget ===== */
/* Hide Recent Activity Widget */
.sidebar-activity {
    display: none !important;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.activity-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.activity-header a {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
}

.activity-header a:hover {
    text-decoration: underline;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--light-gray);
    border-radius: 6px;
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--medium-gray);
}

.activity-icon {
    font-size: 16px;
    line-height: 1;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 11px;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 2px;
}

.activity-text strong {
    font-weight: 600;
}

.activity-details {
    font-size: 10px;
    color: var(--secondary-color);
    line-height: 1.3;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-time {
    font-size: 10px;
    color: var(--secondary-color);
    font-style: italic;
}

/* Scrollbar styling for activity list */
.sidebar-activity::-webkit-scrollbar {
    width: 6px;
}

.sidebar-activity::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.sidebar-activity::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 3px;
}

.sidebar-activity::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 0;
    transition: var(--transition);
}

/* ========================================
   MODERN HEADER STYLES
   ======================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-center {
    flex: 1;
    text-align: center;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

/* Remove/hide menu toggle */
.menu-toggle {
    display: none !important;
}

/* ========================================
   HEADER NAVIGATION MENU (Oracle NetSuite Style)
   ======================================== */

.header-nav {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
}

.header-menu li {
    margin: 0;
}

.header-menu a {
    display: block;
    padding: 10px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.header-menu a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.header-menu a.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* Enhanced datetime display */
.header-date.realtime-date {
    font-size: 15px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
    font-weight: 600;
    min-width: 180px;
    width: 180px;
    display: inline-block;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.timezone-label {
    font-size: 11px;
    color: #e0e7ff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    text-shadow: none;
}

.page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.header-date {
    font-size: 14px;
    color: var(--secondary-color);
}

.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: var(--white);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    padding: 15px;
    border-bottom: 1px solid var(--medium-gray);
    font-weight: 600;
}

.notification-item {
    padding: 15px;
    border-bottom: 1px solid var(--medium-gray);
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background: var(--light-gray);
}

.notification-item:last-child {
    border-bottom: none;
}

/* ========================================
   MODERN PROFILE DROPDOWN
   ======================================== */

.profile-dropdown {
    position: relative;
    z-index: 1001;
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.profile-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffffff;
    color: #667eea;
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-toggle > span:last-child {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Profile Menu Dropdown */
.profile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.profile-menu.show {
    display: block;
    animation: fadeInDropdown 0.2s ease;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.profile-menu a:hover {
    background: #f8fafc;
    color: #1e293b;
}

.profile-menu .menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.profile-menu .menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

.profile-menu .logout-link {
    color: #dc2626;
}

.profile-menu .logout-link:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* ===== Content Area ===== */
.content {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--black);
    margin-bottom: 5px;
}

.breadcrumb {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: var(--secondary-color);
}

/* ===== Cards ===== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info h3 {
    font-size: 32px;
    color: var(--black);
    margin-bottom: 5px;
    line-height: 1;
}

.stat-info p {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 5px;
}

/* ===== Stat Card Percentage ===== */
.stat-percentage {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 12px;
}

.stat-percentage.up {
    color: #10b981;
    background-color: #dcfce7;
}

.stat-percentage.down {
    color: #ef4444;
    background-color: #fee2e2;
}

.stat-percentage.neutral {
    color: #64748b;
    background-color: #f1f5f9;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
}

.stat-icon.blue { background: var(--primary-color); }
.stat-icon.green { background: var(--success-color); }
.stat-icon.orange { background: var(--warning-color); }
.stat-icon.red { background: var(--danger-color); }

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    color: var(--black);
}

.card-body {
    padding: 20px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-group-checkbox {
    margin-bottom: 20px;
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-group-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #d97706;
}

/* Red button for PAY action (unpaid) */
.btn-danger {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    font-weight: 600;
}

.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #991b1b;
}

.btn-danger:active {
    background-color: #991b1b;
    border-color: #7f1d1d;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark-gray);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--medium-gray);
    color: var(--text-color);
}

.btn-outline:hover {
    background: var(--light-gray);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-height: auto;
}

.btn-block {
    width: 100%;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--light-gray);
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--medium-gray);
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--medium-gray);
}

.table tbody tr:hover {
    background: var(--light-gray);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Paid status badge in table actions */
.table-actions .badge-success {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Green badge for PAID state (paid, not clickable) */
.badge-success {
    background-color: #dcfce7;
    color: #15803d;
    font-weight: 600;
    border: 1px solid #86efac;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: default;
    pointer-events: none; /* Prevent any click */
}

span.badge-success {
    cursor: default;
    pointer-events: none; /* Prevent any click */
}

.badge-warning {
    background: #fef3c7;
    color: #a16207;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: var(--medium-gray);
    color: var(--dark-gray);
}

/* ===== Alerts ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #15803d;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fef3c7;
    color: #a16207;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--black);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--secondary-color);
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--medium-gray);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    padding: 15px 20px;
    margin-bottom: 10px;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* ===== Search Bar ===== */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.search-bar svg,
.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--medium-gray);
    cursor: pointer;
}

.search-result-item:hover {
    background: var(--light-gray);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* ===== Loading Spinner ===== */
.spinner {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    display: none;
}

.loading-overlay.show {
    display: flex;
}

/* ===== Profile Picture Upload ===== */
.profile-picture-upload {
    text-align: center;
    margin-bottom: 20px;
}

.profile-picture-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    display: block;
    border: 4px solid var(--medium-gray);
}

.profile-picture-preview.placeholder {
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 600;
}

/* ===== DataTables Custom Styling ===== */
.dataTables_wrapper {
    padding: 20px 0;
}

.dataTables_filter input {
    padding: 8px 12px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    margin-left: 10px;
}

.dataTables_length select {
    padding: 8px 12px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    margin: 0 10px;
}

/* ===== Responsive Design ===== */
@media (max-width: 1199px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .page-title {
        font-size: 18px;
    }
    
    .header {
        padding: 12px 24px;
    }
    
    /* Adjust header menu spacing for tablets */
    .header-menu a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .header-menu {
        gap: 2px;
    }
}

@media (max-width: 768px) {
    /* Sidebar is already hidden globally */
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    /* Hide header navigation menu on mobile, show hamburger menu if needed */
    .header-nav {
        display: none;
    }
    
    .header-center {
        display: none;
    }
    
    .profile-toggle > span:last-child {
        display: none;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .header-date.realtime-date {
        font-size: 13px;
        min-width: 150px;
        width: 150px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .notification-dropdown {
        width: 280px;
        right: -80px;
    }
    
    .profile-menu {
        right: -20px;
    }
    
    .toast-container {
        left: 10px;
        right: 10px;
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .timezone-label {
        display: none;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-info h3 {
        font-size: 28px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.hidden { display: none; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

/* ===== Currency Input Styling ===== */
input#amount-display {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 0.5px;
}

input#amount-display::placeholder {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-style: italic;
    color: #94a3b8;
}

/* ===== Dashboard Charts & Statistics ===== */
.chart-card {
    margin-bottom: 30px;
}

.chart-toggle {
    display: flex;
    gap: 10px;
}

.btn-toggle {
    padding: 8px 16px;
    border: 1px solid var(--medium-gray);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: var(--transition);
}

.btn-toggle:hover {
    background: var(--light-gray);
}

.btn-toggle.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.breakdown-item {
    margin-bottom: 20px;
}

.breakdown-item:last-child {
    margin-bottom: 0;
}

.breakdown-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.breakdown-label span:first-child {
    color: var(--text-color);
    font-weight: 500;
}

.breakdown-value {
    color: var(--primary-color);
    font-weight: 600;
}

.breakdown-bar {
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.breakdown-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.breakdown-fill.income-color {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* ===== Responsive Charts ===== */
@media (max-width: 768px) {
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-toggle {
        width: 100%;
    }
    
    .btn-toggle {
        flex: 1;
    }
    
    .chart-legend {
        justify-content: center;
    }
}

/* ===== Breakdown Tables Styling ===== */
.breakdown-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.breakdown-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
}

.breakdown-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
}

.breakdown-table tbody tr:hover {
    background: #f8f9fa;
}

.breakdown-table .total-row {
    background: #e3f2fd;
    font-weight: 600;
}

.breakdown-table .total-row:hover {
    background: #bbdefb;
}

.balance-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}

.balance-label {
    color: #666;
}

.balance-amount {
    color: #10b981;
    font-weight: 600;
    font-size: 1.1em;
}

.info-box {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.info-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.info-warning strong {
    color: #856404;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-warning {
    background: #ffc107;
    color: #856404;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.text-muted {
    color: #6c757d;
}

/* Tabs styling */
.tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    gap: 5px;
    padding: 0 20px;
}

.tab {
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab:hover {
    color: var(--primary-color);
    background: #f8f9fa;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Responsive improvements for breakdown tables */
@media (max-width: 768px) {
    .breakdown-table {
        font-size: 0.9em;
    }
    
    .breakdown-table thead th,
    .breakdown-table tbody td {
        padding: 8px;
    }
}

/* ========================================
   HEADER STYLES
   ======================================== */

.main-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.header-left {
    flex: 1;
}

.page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

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

/* ========================================
   USER DROPDOWN
   ======================================== */

.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-dropdown-toggle:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    color: #64748b;
}

.user-dropdown-toggle:hover .dropdown-arrow {
    color: #1e293b;
}

/* Rotate arrow when dropdown is open */
.user-dropdown-menu.show ~ .user-dropdown-toggle .dropdown-arrow,
.user-dropdown-toggle:has(~ .user-dropdown-menu.show) .dropdown-arrow {
    transform: rotate(180deg);
}

/* ========================================
   DROPDOWN MENU
   ======================================== */

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-user-info strong {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.dropdown-user-info small {
    font-size: 12px;
    color: #64748b;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #1e293b;
}

.dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.logout-item {
    color: #dc2626;
}

.logout-item:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* ========================================
   SIDEBAR UPDATES
   ======================================== */

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-dropdown-toggle {
        padding: 8px;
    }
    
    .header-content {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .user-dropdown-menu {
        right: -8px;
        min-width: 200px;
    }
}
