/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary: #3867d6;
    --primary-hover: #2653c6;
    --primary-light: rgba(56, 103, 214, 0.2);
    --secondary: #1F1D2B;
    --surface: #1F1D2B;
    --background: #252836;
    --text-main: #FFFFFF;
    --text-muted: #ABBBC2;
    --border: #393C49;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.2), 0 2px 4px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.2), 0 4px 6px -2px rgba(0,0,0,0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --primary: #3867d6;
    --primary-hover: #2653c6;
    --primary-light: rgba(56, 103, 214, 0.1);
    --secondary: #f3f4f6;
    --surface: #ffffff;
    --background: #f9fafb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
}

* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--background); margin: 0; color: var(--text-main); line-height: 1.5; -webkit-font-smoothing: antialiased; }

.page-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 280px; background: var(--surface); color: var(--text-main); display: flex; flex-direction: column; position: relative; z-index: 10; border-right: 1px solid var(--border); }
.sidebar-header { padding: 24px; font-size: 1.25rem; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.sidebar-header i { color: var(--primary); font-size: 1.5rem; }
.nav-menu { list-style: none; margin: 0; padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item { cursor: pointer; padding: 12px 16px; border-radius: 12px; transition: var(--transition); display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text-muted); text-decoration: none; }
.nav-item i { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-item:hover { background: var(--background); color: var(--text-main); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px var(--primary-light); }
.sidebar-footer { padding: 24px; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--border); line-height: 1.6; }

/* Main Content */
.main { flex: 1; padding: 32px 40px; overflow-y: auto; height: 100vh; }
.toolbar { margin-bottom: 32px; }
.toolbar h1 { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.025em; }
.toolbar p { margin: 8px 0 0; color: var(--text-muted); font-size: 1.05rem; }

/* Cards & Stats */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 32px; }
.stat { padding: 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; position: relative; overflow: hidden; border: 1px solid var(--border); transition: var(--transition); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat .icon-bg { position: absolute; right: -10px; bottom: -10px; font-size: 5rem; opacity: 0.03; z-index: 0; pointer-events: none; }
.stat h3 { margin: 0 0 8px; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); position: relative; z-index: 1; }
.stat strong { display: block; font-size: 2rem; font-weight: 700; color: var(--text-main); position: relative; z-index: 1; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 28px; margin-bottom: 24px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title { font-size: 1.25rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); }
.section-note { color: var(--text-muted); margin-top: 4px; margin-bottom: 24px; font-size: 0.95rem; }

/* Tabs */
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Forms */
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.input-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
input, select, textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--background); font-size: 0.95rem; color: var(--text-main); transition: var(--transition); font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 2px var(--primary-light); }
textarea { min-height: 100px; resize: vertical; }

/* Search Bar */
.search-bar { position: relative; max-width: 300px; width: 100%; }
.search-bar i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-bar input { padding-left: 40px; border-radius: 99px; }

/* Buttons */
button, .btn { font-family: inherit; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box; }
button.primary, .btn.primary { background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: 14px 24px; cursor: pointer; font-weight: 600; font-size: 1rem; width: 100%; box-shadow: 0 4px 6px var(--primary-light); }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 12px var(--primary-light); }
button.secondary, .btn.secondary { background: var(--background); color: var(--text-main); border: 1px solid var(--border); border-radius: 12px; padding: 12px 20px; cursor: pointer; font-weight: 600; }
button.secondary:hover, .btn.secondary:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); }
button.danger, .btn.danger { background: var(--danger); color: #fff; border: none; border-radius: 12px; padding: 14px 24px; cursor: pointer; font-weight: 600; font-size: 1rem; }
button.danger:hover, .btn.danger:hover { background: #dc2626; }

/* Tables */
.table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 800px; background: var(--surface); }
th, td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--background); color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--background); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge.pending { background: rgba(245,158,11,0.2); color: #fcd34d; }
.badge.paid { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.badge.settled { background: rgba(79,70,229,0.2); color: #a5b4fc; }
.badge.cancelled { background: rgba(239,68,68,0.2); color: #fca5a5; }
.badge.bounced { background: rgba(219,39,119,0.2); color: #f9a8d4; }
.badge.present { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.badge.absent { background: rgba(239,68,68,0.2); color: #fca5a5; }
.badge.leave { background: rgba(245,158,11,0.2); color: #fcd34d; }
.badge.active { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.badge.inactive { background: rgba(100,116,139,0.2); color: #cbd5e1; }

/* Action Buttons */
.action-buttons { display: flex; gap: 8px; }
.action-button { border: none; border-radius: 8px; padding: 8px; cursor: pointer; color: var(--text-muted); background: transparent; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.action-button:hover { background: var(--secondary); }
.action-button.edit:hover { color: var(--primary); background: var(--primary-light); }
.action-button.delete:hover { color: var(--danger); background: #fee2e2; }

/* Toast Notifications */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast { background: var(--surface); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary); display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 400px; transform: translateX(120%); opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); pointer-events: auto; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.danger { border-color: var(--danger); }
.toast.danger i { color: var(--danger); }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.toast-message { font-size: 0.85rem; color: var(--text-muted); }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; }
.toast-close:hover { background: var(--secondary); color: var(--text-main); }

/* Utilities */
.d-none { display: none !important; }

@media (max-width: 1024px) { 
    .main { padding: 24px; } 
    .cards-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) { 
    .page-shell { flex-direction: column; } 
    .sidebar { width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; } 
    .nav-menu { flex-direction: row; overflow-x: auto; padding: 12px; gap: 8px; }
    .nav-item { padding: 8px 12px; font-size: 0.9rem; white-space: nowrap; }
    .sidebar-footer { display: none; }
    .grid-two { grid-template-columns: 1fr; } 
    .cards-grid { grid-template-columns: 1fr; }
}
