/* Teetar.Hub Design System */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --accent: #ffa73a;
    --bg-deepest: #0a0e17;
    --bg-dark: #0f1419;
    --bg-medium: #151b28;
    --bg-card: #1a2233;
    --bg-secondary: #1e2940;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #64748b;
    --border-color: #2d3748;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --critical: #dc2626;
    --radius-card: 12px;
    --radius-btn: 0.75rem;
    --transition: all 0.2s ease;
    --accent-glow: rgba(59, 130, 246, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-deepest);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0c1222, #111a2e);
    border-right: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding-top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: none;
}

.sidebar-header h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    margin: 0;
}

.nav-section-label {
    padding: 1.25rem 1.5rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.625rem 1.5rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
}

.sidebar .nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    color: var(--primary);
    border-left-color: transparent;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 8px var(--accent-glow);
    border-radius: 0 2px 2px 0;
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    padding: 1rem 2rem;
    background: linear-gradient(180deg, #0d1526, #0c1222);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

.content-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Cards */
.card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--accent-glow);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
    color: var(--text-primary);
}

.card-header h6,
.card-body h6 {
    color: var(--text-primary);
}

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.1);
}

/* Stat card color variants */
.stat-card-primary {
    border-left: 3px solid var(--primary);
}

.stat-card-primary:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.15);
}

.stat-card-success {
    border-left: 3px solid var(--success);
}

.stat-card-success:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 20px rgba(16, 185, 129, 0.15);
}

.stat-card-warning {
    border-left: 3px solid var(--warning);
}

.stat-card-warning:hover {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 20px rgba(245, 158, 11, 0.15);
}

.stat-card-error {
    border-left: 3px solid var(--error);
}

.stat-card-error:hover {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 20px rgba(239, 68, 68, 0.15);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-card-sm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.stat-value-sm {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Buttons */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    border-radius: var(--radius-btn);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: var(--transition);
}

.btn-gradient:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1d4ed8);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.15);
    color: white;
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    border: none;
    color: #000;
    border-radius: var(--radius-btn);
    font-weight: 600;
    transition: var(--transition);
}

.btn-accent:hover {
    background: #ffb94d;
    color: #000;
    transform: translateY(-1px);
}

.btn {
    border-radius: var(--radius-btn);
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

/* Tables */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: rgba(59, 130, 246, 0.08);
    --bs-table-color: var(--text-primary);
}

.table-responsive {
    border-radius: var(--radius-card);
    overflow: hidden;
}

.table-dark thead th {
    background: linear-gradient(180deg, #1e2940, var(--bg-medium));
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.table-dark td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.table-dark tbody tr {
    transition: var(--transition);
}

.table-dark tbody tr:hover td {
    background-color: rgba(59, 130, 246, 0.08);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
}

.badge-queued {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.badge-sent {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-failed {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.badge-active {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-inactive {
    background-color: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

.badge-warning-severity {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-error-severity {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.badge-critical-severity {
    background-color: rgba(220, 38, 38, 0.25);
    color: #f87171;
}

.bg-critical {
    background-color: var(--critical);
}

.text-critical {
    color: #f87171;
}

/* Forms */
.form-control,
.form-select {
    background-color: var(--bg-medium);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-btn);
    padding: 0.625rem 1rem;
    transition: var(--transition);
}

.form-control:hover,
.form-select:hover {
    border-color: #4a5568;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-medium);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 0 12px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.form-check-input {
    background-color: var(--bg-medium);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Auth Page */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #0f1729, var(--bg-deepest));
}

.login-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Alerts */
.alert {
    border-radius: var(--radius-btn);
    border: 1px solid var(--border-color);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.alert code {
    color: var(--accent);
    background-color: var(--bg-deepest);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    word-break: break-all;
}

.btn-close {
    filter: invert(1);
}

/* Text Colors */
.text-primary {
    color: var(--primary) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--error) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Pagination */
.page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    transition: var(--transition);
}

.page-link:hover {
    background-color: var(--bg-medium);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.page-item.disabled .page-link {
    background-color: var(--bg-dark);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* Filters */
.filter-bar {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Pre/Code blocks */
pre {
    background-color: var(--bg-deepest);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-btn);
    padding: 1rem;
    color: var(--text-secondary);
    overflow-x: auto;
    max-height: 500px;
}

pre code {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Action buttons in tables */
.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Detail view */
.detail-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

/* Outline button overrides for dark theme */
.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: var(--bg-medium);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.btn-outline-danger {
    color: var(--error);
    border-color: var(--error);
}

.btn-outline-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.btn-outline-warning {
    color: var(--warning);
    border-color: var(--warning);
}

.btn-outline-warning:hover {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.btn-outline-success {
    color: var(--success);
    border-color: var(--success);
}

.btn-outline-success:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* bg-warning-subtle override for dark theme */
.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.15) !important;
}

.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 1rem;
    }
}

/* Validation */
.field-validation-error {
    color: var(--error);
    font-size: 0.8rem;
}

.input-validation-error {
    border-color: var(--error) !important;
}
