/* Modern Treasury Styles - Shared across Treasury pages */

/* CSS Variables */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --info-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);

  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 15px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Eye-friendly status colors */
  --status-pending-bg: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
  --status-pending-color: #92400e;
  --status-paid-bg: linear-gradient(135deg, #d1fae5 0%, #10b981 100%);
  --status-paid-color: #065f46;
  --status-cancelled-bg: linear-gradient(135deg, #fee2e2 0%, #f87171 100%);
  --status-cancelled-color: #991b1b;
  --status-processing-bg: linear-gradient(135deg, #dbeafe 0%, #60a5fa 100%);
  --status-processing-color: #1e40af;
  /* Approved/Active: light green */
  --status-approved-bg: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
  --status-approved-color: #065f46;
  --status-office-bg: linear-gradient(135deg, #f3f4f6 0%, #9ca3af 100%);
  --status-office-color: #374151;

  /* Sidebar palette (light blue) */
  --sidebar-bg: linear-gradient(180deg, #e8f1ff 0%, #d7e9ff 100%);
  --sidebar-hover-bg: rgba(102, 126, 234, 0.12); /* based on primary */
  --sidebar-active-bg: rgba(102, 126, 234, 0.18);
}

/* Base and layout */
body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Top navbar */
.top-navbar { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,0.1); box-shadow: 0 2px 20px rgba(0,0,0,0.1); }
.brand-title { font-weight: 700; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand-subtitle { font-size: 0.875rem; color: #6c757d; }

/* Sidebar */
.sidebar { background: var(--sidebar-bg); backdrop-filter: blur(20px); border-right: 1px solid rgba(0,0,0,0.1); box-shadow: 2px 0 20px rgba(0,0,0,0.1); }
.sidebar-header h3 { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }
.sidebar-menu li a { transition: var(--transition); border-radius: 12px; margin: 0.25rem 0; color: #111 !important; }
/* Keep text black and use subtle light blue backgrounds for visibility */
.sidebar-menu li a:hover { background: var(--sidebar-hover-bg); color: #111 !important; transform: translateX(10px); }
.sidebar-menu li a.active { background: var(--sidebar-active-bg); color: #111 !important; box-shadow: 0 4px 15px rgba(102,126,234,0.15); }

/* Container */
.container-fluid { padding: 2rem; }

/* Cards */
.dashboard-card { background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border-radius: var(--border-radius); padding: 2rem; box-shadow: var(--card-shadow); transition: var(--transition); border: 1px solid rgba(255,255,255,0.2); position: relative; overflow: hidden; }
.dashboard-card::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background: var(--primary-gradient); }
.dashboard-card:hover { transform: translateY(-10px); box-shadow: var(--card-shadow-hover); }

/* Buttons */
.btn { border-radius: var(--border-radius); font-weight: 600; transition: var(--transition); position: relative; overflow: hidden; border: none; }
.btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: left 0.5s; }
.btn:hover::before { left: 100%; }
.btn-primary { background: var(--primary-gradient); box-shadow: 0 4px 15px rgba(102,126,234,0.4); }
.btn-success { background: var(--success-gradient); box-shadow: 0 4px 15px rgba(79,172,254,0.4); }
.btn-warning { background: var(--warning-gradient); box-shadow: 0 4px 15px rgba(67,233,123,0.4); }
.btn-danger { background: var(--danger-gradient); box-shadow: 0 4px 15px rgba(250,112,154,0.4); }
.btn-info { background: var(--info-gradient); box-shadow: 0 4px 15px rgba(168,237,234,0.4); }
.btn-outline-info { border: 2px solid transparent; background: linear-gradient(#fff,#fff) padding-box, var(--info-gradient) border-box; color: #0ea5e9; font-size: 0.75rem; padding: 0.25rem 0.5rem; }
.btn-outline-primary { border: 2px solid transparent; background: linear-gradient(#fff,#fff) padding-box, var(--primary-gradient) border-box; color: #667eea; }
.btn-outline-secondary { border: 2px solid transparent; background: linear-gradient(#fff,#fff) padding-box, var(--dark-gradient) border-box; color: #2c3e50; }

/* Button groups */
.btn-group-vertical .btn { margin-bottom: .25rem; font-size: .75rem; padding: .25rem .5rem; border-radius: 8px; }
.btn-group-vertical .btn:last-child { margin-bottom: 0; }

/* Ripple effect */
.ripple { position: relative; overflow: hidden; }
.ripple::before { content:''; position:absolute; top:50%; left:50%; width:0; height:0; border-radius:50%; background: rgba(255,255,255,0.5); transform: translate(-50%,-50%); transition: width .6s, height .6s; }
.ripple:active::before { width:300px; height:300px; }

/* Status badges */
.status-badge { padding: .6rem 1.2rem; border-radius: 25px; font-size: .875rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; min-width: 100px; position: relative; overflow: hidden; transition: var(--transition); border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(10px); }
.status-badge::before { content:''; position:absolute; inset:0; background: inherit; opacity: .1; animation: statusPulse 3s ease-in-out infinite; }
@keyframes statusPulse { 0%,100%{opacity:.1} 50%{opacity:.3} }
.status-pending { background: var(--status-pending-bg); color: var(--status-pending-color); box-shadow: 0 4px 15px rgba(251,191,36,0.3); }
.status-paid, .status-completed { background: var(--status-paid-bg); color: var(--status-paid-color); box-shadow: 0 4px 15px rgba(16,185,129,0.3); }
.status-cancelled, .status-rejected { background: var(--status-cancelled-bg); color: var(--status-cancelled-color); box-shadow: 0 4px 15px rgba(248,113,113,0.3); }
.status-processing, .status-under-review { background: var(--status-processing-bg); color: var(--status-processing-color); box-shadow: 0 4px 15px rgba(96,165,250,0.3); }
.status-approved { background: var(--status-approved-bg); color: var(--status-approved-color); box-shadow: 0 4px 15px rgba(16,185,129,0.3); }
.status-sanggunian-processing, .status-bplo-processing, .status-treasury-processing { background: var(--status-office-bg); color: var(--status-office-color); box-shadow: 0 4px 15px rgba(156,163,175,0.3); }

/* Tables (Applications) */
#applicationsTable { font-size: .85rem; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--card-shadow); }
#applicationsTable th { white-space: nowrap; background: var(--primary-gradient); color: #fff; font-weight: 600; padding: 1rem; position: sticky; top: 0; z-index: 10; }
#applicationsTable td { vertical-align: middle; padding: 1rem; border-bottom: 1px solid rgba(0,0,0,0.05); transition: var(--transition); }
#applicationsTable tbody tr:hover { background: rgba(102,126,234,0.05); transform: scale(1.01); }
.table-responsive { overflow-x: auto; max-width: 100%; border-radius: var(--border-radius); box-shadow: var(--card-shadow); }
.dashboard-table th, .dashboard-table td { white-space: nowrap; min-width: 100px; }
.dashboard-table th:first-child, .dashboard-table td:first-child { min-width: 120px; }
.dashboard-table th:last-child, .dashboard-table td:last-child { min-width: 150px; }
.dashboard-table td:nth-child(5), .dashboard-table td:nth-child(7), .dashboard-table td:nth-child(21) { max-width: 220px; white-space: normal; word-wrap: break-word; }

/* User info */
.user-info { display: flex; align-items: center; gap: 1rem; }
.user-info span { font-weight: 600; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.user-info img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; background: linear-gradient(#fff,#fff) padding-box, var(--primary-gradient) border-box; }

/* Logout modal */
.logout-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(10px); z-index: 1000; justify-content: center; align-items: center; animation: modalFadeIn .3s ease-out; }
@keyframes modalFadeIn { from{opacity:0; transform: scale(0.95);} to{opacity:1; transform: scale(1);} }
.logout-modal-content { background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); padding: 2.5rem; border-radius: var(--border-radius); box-shadow: var(--card-shadow-hover); text-align: center; max-width: 420px; width: 90%; border: 1px solid rgba(255,255,255,0.2); }
.logout-modal-icon { font-size: 3.5rem; background: var(--danger-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 1.5rem; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
.logout-modal-buttons { margin-top: 2rem; display: flex; justify-content: center; gap: 1rem; }
.logout-modal-buttons .btn { padding: .75rem 2rem; border-radius: var(--border-radius); font-weight: 600; }

/* Alerts (used in forms/settings) */
.alert { border-radius: var(--border-radius); border: none; backdrop-filter: blur(20px); position: relative; overflow: hidden; }
.alert::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background: var(--primary-gradient); }
.alert-warning::before { background: var(--warning-gradient); }
.alert-danger::before { background: var(--danger-gradient); }
.alert-success::before { background: var(--success-gradient); }

/* Responsive tweaks */
@media (max-width: 768px) {
  .dashboard-card { padding: 1.5rem; margin-bottom: 1rem; }
}
