/* admin/css/admin.css - Ultra-Light Clean CSS Framework for Admin Dashboard */
:root {
    --c-primary: #0f172a;
    --c-secondary: #2563eb;
    --c-secondary-alt: #1d4ed8;
    --c-text: #334155;
    --c-text-light: #64748b;
    --c-bg: #f8fafc;
    --c-sidebar: #1e293b;
    --c-border: #e2e8f0;
    --font-stack: 'Inter', system-ui, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --radius-md: 8px;
    --radius-sm: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-stack); color: var(--c-text); background: var(--c-bg); line-height: 1.5; font-size: 14px; }
a { text-decoration: none; color: var(--c-secondary); }
h1, h2, h3 { color: var(--c-primary); font-weight: 600; margin-bottom: 0.5rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 500; cursor: pointer; font-size: 14px; transition: 0.2s; }
.btn-primary { background: var(--c-secondary); color: white; }
.btn-primary:hover { background: var(--c-secondary-alt); }
.btn-outline { background: transparent; border-color: var(--c-border); color: var(--c-text); }
.btn-outline:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 12px; }
.btn-block { width: 100%; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 14px; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }

/* Global Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 14px; }
.form-group input { width: 100%; padding: 0.75rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-family: var(--font-stack); }
.form-group input:focus { outline: none; border-color: var(--c-secondary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Login Page Only */
.login-bg { background: linear-gradient(135deg, var(--c-primary) 0%, #334155 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 400px; padding: 1rem; }
.login-card { background: white; padding: 2.5rem; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.login-header h2 span { color: var(--c-secondary); }
.login-header p { color: var(--c-text-light); font-size: 13px; }
.login-footer { margin-top: 1.5rem; text-align: center; font-size: 12px; color: #94a3b8; }

/* Dashboard Layout Structure */
.admin-header { height: 60px; background: white; border-bottom: 1px solid var(--c-border); display: flex; justify-content: space-between; align-items: center; padding: 0 1.5rem; position: sticky; top: 0; z-index: 50; }
.brand-area strong { letter-spacing: -0.5px; color: var(--c-primary); }
.brand-area span { font-weight: 400; color: var(--c-text-light); margin-left: 0.5rem; font-size: 12px; }
.user-area { display: flex; align-items: center; gap: 1rem; }
.user-area span { font-weight: 500; }

.admin-wrapper { display: flex; min-height: calc(100vh - 60px); }

/* Sidebar */
.admin-sidebar { width: 250px; background: var(--c-sidebar); color: #cbd5e1; flex-shrink: 0; }
.side-nav ul { list-style: none; padding: 1rem 0; }
.side-nav li a { display: block; padding: 0.75rem 1.5rem; color: #94a3b8; font-weight: 500; transition: 0.2s; }
.side-nav li a:hover, .side-nav li.active a { color: white; background: rgba(255,255,255,0.05); border-left: 3px solid var(--c-secondary); }

/* Main Content Wrapper */
.admin-content { flex: 1; padding: 2rem; min-width: 0; overflow-x: hidden; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; }
.page-header p { color: var(--c-text-light); }
.mt-2 { margin-top: 2rem; }

/* Cards & KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.kpi-card { background: white; padding: 1.5rem; border-radius: var(--radius-md); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); }
.kpi-title { font-size: 13px; color: var(--c-text-light); font-weight: 500; text-transform: uppercase; margin-bottom: 0.5rem; }
.kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--c-primary); }

.card { background: white; border: 1px solid var(--c-border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 2rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--c-border); display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-size: 1.1rem; margin: 0; }
.card-header .subtitle { font-size: 13px; color: var(--c-text-light); margin-top: 0.25rem; font-weight: 400; }

/* Tables */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { background: #f8fafc; padding: 0.75rem 1.5rem; font-weight: 600; font-size: 12px; color: var(--c-text-light); text-transform: uppercase; border-bottom: 1px solid var(--c-border); }
.admin-table td { padding: 1rem 1.5rem; border-bottom: 1px solid var(--c-border); font-size: 14px; white-space: nowrap; }
.admin-table tbody tr:hover { background: #fdfdfd; }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { padding: 0.25rem 0.5rem; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.badge-success { background: #dcfce3; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-admin { background: #ede9fe; color: #5b21b6; }
.badge-business { background: #e0e7ff; color: #3730a3; }
.badge-client { background: #f1f5f9; color: #475569; }

/* App Grid Dashboard */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; padding: 1.5rem; }
.app-box { border: 1px solid var(--c-border); padding: 1.5rem; border-radius: var(--radius-sm); display: flex; gap: 1rem; transition: 0.2s; position: relative; }
.app-box:hover { border-color: var(--c-secondary); box-shadow: var(--shadow-sm); }
.app-icon { font-size: 2rem; }
.app-info h3 { font-size: 14px; margin-bottom: 0.25rem; }
.app-info p { font-size: 12px; color: var(--c-text-light); margin-bottom: 1rem; }
.app-link { font-size: 12px; font-weight: 600; color: var(--c-secondary); }
.app-link:hover { text-decoration: underline; }
.app-status { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 11px; font-weight: 500; font-style: italic; color: #64748b; display: flex; align-items: center; gap: 4px; }
.dot-online { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; display: inline-block; }

/* Grid Wrapper Responsiveness */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .admin-wrapper { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .side-nav ul { display: flex; overflow-x: auto; padding: 0; }
    .side-nav li a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .side-nav li.active a { border-left: none; border-bottom-color: var(--c-secondary); }
    .user-area span { display: none; } /* hide email on mobile */
    .admin-content { padding: 1rem; }
}
