/* assets/css/admin.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #2563eb; /* Blue accent */
    --hover-bg: #eff6ff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --sidebar-width: 250px;
    --bg-color: #f8f9fa;
    --card-bg: #fff;
    --border-color: #e5e7eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg-color); color: var(--text-main); display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: #ffffff; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; height: 100vh; position: fixed; left: 0; top: 0; z-index: 100; transition: transform 0.3s; }
.logo-container { padding: 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid transparent; }
.logo-container .logo-icon { background: #dc2626; color: #fff; border-radius: 4px; padding: 2px 8px; font-weight: bold; }
.logo-container h2 { font-weight: 800; color: #dc2626; font-size: 1.25rem; }

.nav-menu { padding: 15px 0; overflow-y: auto; flex: 1; }
.nav-item { padding: 12px 20px; color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 500; transition: all 0.2s; cursor: pointer; }
.nav-item:hover { color: var(--primary); background: var(--hover-bg); }
.nav-item.active { background: var(--primary); color: #fff; border-radius: 6px; margin: 0 10px; padding: 12px 10px; }
.nav-item i { font-size: 1.1rem; width: 24px; text-align: center; }

.submenu { display: none; background: #fff; padding: 5px 0 5px 40px; }
.submenu.open { display: block; }
.submenu a { display: block; padding: 8px 10px; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; border-radius: 6px; margin-right: 10px; transition: all 0.2s; }
.submenu a:hover { color: var(--primary); background: var(--hover-bg); }
.submenu a.active { color: var(--primary); font-weight: 600; background: var(--hover-bg); }

.sidebar-footer { padding: 20px; font-size: 0.8rem; color: var(--text-muted); text-align: center; border-top: 1px solid var(--border-color); }

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; width: calc(100% - var(--sidebar-width)); min-height: 100vh; }

/* Top Header */
.top-header { height: 70px; background: #fff; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 90; }
.header-left { display: flex; align-items: center; gap: 20px; }
.menu-toggle { font-size: 1.25rem; color: var(--text-muted); cursor: pointer; display: none; }
.search-bar { background: var(--bg-color); border-radius: 6px; display: flex; align-items: center; padding: 8px 15px; width: 300px; }
.search-bar i { color: var(--text-muted); margin-right: 10px; }
.search-bar input { border: none; background: transparent; outline: none; width: 100%; font-family: 'Inter'; }

.header-right { display: flex; align-items: center; gap: 20px; }
.header-icon { color: var(--text-muted); font-size: 1.2rem; cursor: pointer; position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-color); transition: background 0.2s; }
.header-icon:hover { background: #e5e7eb; color: var(--text-main); }
.user-avatar { width: 36px; height: 36px; background: #dc2626; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; }

/* Content Area */
.content-area { padding: 30px; overflow-y: auto; flex: 1; background: var(--bg-color); }

/* Cards Array */
.dash-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.d-card { padding: 20px; border-radius: 12px; display: flex; flex-direction: column; position: relative; }
.d-card-blue { background: #e0f2fe; } /* Views */
.d-card-purple { background: #f3e8ff; } /* Payment */
.d-card-green { background: #dcfce3; } /* Revenue */

.d-card .icon-box { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.d-card-blue .icon-box { background: #bae6fd; color: #0284c7; }
.d-card-purple .icon-box { background: #e9d5ff; color: #9333ea; }
.d-card-green .icon-box { background: #bbf7d0; color: #16a34a; }

.d-card p.title { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; }
.d-card h3 { font-size: 2rem; font-weight: 700; color: var(--text-main); margin-bottom: 15px; }
.d-card .stat { font-size: 0.8rem; display: flex; align-items: center; gap: 5px; color: var(--text-muted); }
.d-card .stat span.up { color: #16a34a; background: rgba(22,163,74,0.1); padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.d-card .stat span.down { color: #dc2626; background: rgba(220,38,38,0.1); padding: 2px 6px; border-radius: 4px; font-weight: 600; }

/* Panels */
.panel { background: var(--card-bg); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); padding: 20px; margin-bottom: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.panel-header h3 { font-size: 1.1rem; font-weight: 600; }
.panel-header a { color: var(--primary); text-decoration: none; font-size: 0.9rem; font-weight: 500; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { text-align: left; padding: 12px 15px; color: var(--text-main); font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid var(--border-color); white-space: nowrap; }
table td { padding: 15px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; color: var(--text-muted); vertical-align: middle; }

/* Status Badges */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.badge.active { background: #dcfce3; color: #166534; }
.badge.inactive { background: #fee2e2; color: #991b1b; }

/* Utilities */
.btn { display: inline-block; padding: 8px 16px; background: var(--primary); color: #fff; text-decoration: none; border-radius: 6px; font-weight: 500; font-size: 0.9rem; border: none; cursor: pointer; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

@media (max-width: 1024px) {
    .dash-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle { display: block; }
    .dash-cards { grid-template-columns: 1fr; }
}
