/* Salient AI Platform - Dashboard Styles */
:root {
    --primary: #263e70;
    --primary-light: #3457a0;
    --primary-dark: #1a2d52;
    --accent: #34a7b1;
    --accent-dark: #2a8a92;
    --gold: #f0ad03;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--gray-100); color: var(--gray-800); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px; background: var(--primary); color: #fff;
    padding: 0; flex-shrink: 0; position: fixed; top: 0; bottom: 0; overflow-y: auto;
    display: flex; flex-direction: column;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px; font-size: 1rem; font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar .brand-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar .brand small { display: block; font-size: .65rem; color: rgba(255,255,255,.4); font-weight: 400; margin-top: 2px; }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px; color: rgba(255,255,255,.7); font-size: .88rem;
    transition: .15s; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--accent); }
.sidebar nav .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar nav .divider { height: 1px; background: rgba(255,255,255,.08); margin: 8px 20px; }

.sidebar .sidebar-footer {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar .sidebar-footer a { color: rgba(255,255,255,.5); font-size: .8rem; }
.sidebar .sidebar-footer a:hover { color: #fff; }
.sidebar .sidebar-powered { margin-top: 10px; font-size: .7rem; }
.sidebar .sidebar-powered a { color: rgba(255,255,255,.35); font-weight: 600; }

.admin-badge {
    display: flex; align-items: center; gap: 8px;
    font-size: .82rem; color: rgba(255,255,255,.8);
    margin-bottom: 10px; padding: 8px 10px; background: rgba(0,0,0,.15); border-radius: 6px;
}
.admin-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.admin-role { font-size: .68rem; color: rgba(255,255,255,.4); margin-left: auto; text-transform: uppercase; letter-spacing: .04em; }

.main { margin-left: 260px; flex: 1; padding: 30px; min-width: 0; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.5rem; color: var(--gray-900); }
.page-header .breadcrumb { font-size: .85rem; color: var(--gray-500); }
.page-header .breadcrumb a { color: var(--gray-500); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; border-left: 4px solid var(--gray-300); transition: .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-label { font-size: .78rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin-top: 4px; }
.stat-card .stat-sub { font-size: .78rem; color: var(--gray-400); margin-top: 4px; }
.stat-card.primary { border-left-color: var(--primary); }
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.gold { border-left-color: var(--gold); }

/* Cards */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200); }
.card-header h2 { font-size: 1.1rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.form-group small { color: var(--gray-400); font-size: .78rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="tel"],
select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300);
    border-radius: var(--radius); font-size: .9rem; font-family: inherit; transition: .15s; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(38,62,112,.1); }
textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border: none; border-radius: var(--radius); font-size: .9rem; font-weight: 500; cursor: pointer; transition: .15s; font-family: inherit; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-xs { padding: 4px 10px; font-size: .75rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead { background: var(--gray-50); }
th { text-align: left; padding: 10px 12px; font-weight: 600; color: var(--gray-600); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--gray-200); }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:hover { background: var(--gray-50); }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-suspended { background: #fef3c7; color: #92400e; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-sent { background: #dcfce7; color: #166534; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #dbeafe; color: #1e40af; }
.badge-skipped { background: var(--gray-200); color: var(--gray-600); }
.badge-starter { background: var(--gray-200); color: var(--gray-700); }
.badge-pro { background: #dbeafe; color: #1e40af; }
.badge-agency { background: #f3e8ff; color: #7c3aed; }
.badge-enterprise { background: #fef3c7; color: #92400e; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Code blocks */
.code-block {
    background: var(--gray-900); color: #e5e7eb; padding: 16px; border-radius: var(--radius);
    font-family: 'SF Mono', 'Consolas', monospace; font-size: .82rem;
    overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow-y: auto;
    position: relative;
}
.code-block .copy-btn {
    position: absolute; top: 8px; right: 8px; padding: 4px 10px; background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15); border-radius: 4px; color: #ccc; font-size: .72rem;
    cursor: pointer; transition: .15s;
}
.code-block .copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: .85rem; color: var(--gray-600); }
.pagination a:hover { background: var(--gray-50); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Client detail info grid */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-item label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); display: block; margin-bottom: 2px; }
.info-item .value { font-size: .95rem; color: var(--gray-800); font-weight: 500; }

/* Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: .8rem; }
.text-xs { font-size: .75rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.items-center { align-items: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.mono { font-family: 'SF Mono', 'Consolas', monospace; font-size: .82rem; }
.empty-state { text-align: center; padding: 40px; color: var(--gray-400); }

/* Login page */
.login-page {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(135deg, #263e70 0%, #1a2d52 50%, #0f1b33 100%);
    padding: 20px;
}
.login-container { width: 100%; max-width: 400px; }
.login-card {
    background: #fff; border-radius: 16px; padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card h1 { font-size: 1.4rem; color: var(--gray-900); text-align: center; margin-bottom: 4px; }
.login-card > p { text-align: center; font-size: .87rem; color: var(--gray-500); margin-bottom: 28px; }
.login-card .form-group label { color: var(--gray-700); }
.login-card .btn-primary {
    width: 100%; padding: 12px; font-size: .95rem; font-weight: 600;
    background: var(--primary); border-radius: 10px; margin-top: 8px;
}
.login-card .btn-primary:hover { background: var(--primary-dark); }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 14px; margin-bottom: 12px;
    background: var(--primary); box-shadow: 0 6px 20px rgba(38,62,112,.4);
}
.login-brand-name { font-size: 1.2rem; font-weight: 800; color: var(--gray-900); }
.login-footer { text-align: center; margin-top: 24px; font-size: .78rem; color: rgba(255,255,255,.3); }
.login-footer a { color: rgba(255,255,255,.5); }

/* Tab navigation */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; gap: 0; }
.tabs a {
    padding: 10px 20px; color: var(--gray-500); font-size: .88rem; font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -2px; transition: .15s;
}
.tabs a:hover { color: var(--gray-700); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 16px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .info-grid { grid-template-columns: 1fr; }
}
