/* SaaS Admin Custom Styles */
:root {
    --sidebar-width: 250px; /* Slightly narrower sidebar */
    --bg-main: #f9fafb; /* Very light background */
    --bg-card: #ffffff; /* White cards */
    --sidebar-bg: #1f2937; /* Darker slate for sidebar */
    --primary: #6366f1; /* Tailwind Indigo 500 */
    --primary-hover: #4f46e5; /* Darker indigo for hover */
    --text-main: #111827; /* Dark gray for main text */
    --text-muted: #6b7280; /* Medium gray for muted text */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --danger: #e11d48;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main); /* Apply main text color */
    font-family: 'Inter', sans-serif;
    margin: 0;
}

/* Layout Structure */
.saas-container {
    display: flex;
    min-height: 100vh; /* Ensure full viewport height */
}

.saas-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    position: fixed; /* Fixed sidebar */
    height: 100%;
    z-index: 50;
    transition: all 0.3s ease;
}

.saas-main {
    flex: 1;
    margin-left: var(--sidebar-width); /* Adjust main content for sidebar width */
    display: flex;
    flex-direction: column;
}

/* Header */
.saas-header {
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color); /* Subtle border */
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space out items */
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

/* Navigation */
.saas-nav {
    padding: 1rem;
    display: flex; /* Flex container for nav items */
    flex-direction: column; /* Stack nav items vertically */
    gap: 0.25rem; /* Small gap between items */
}

.saas-nav-link {
    display: flex;
    align-items: center; /* Align icon and text */
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.saas-nav-link i { margin-right: 0.75rem; width: 20px; text-align: center; }
.saas-nav-link:hover, .saas-nav-link.active { /* Hover and active states */
    background: rgba(255, 255, 255, 0.1); /* Lighter background on hover/active */
    color: white; /* White text */
}

.nav-section-title { color: #9ca3af; font-size: 0.75rem; text-transform: uppercase; font-weight: 600; padding: 1.5rem 1rem 0.5rem; } /* Muted section titles */

.saas-content {
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem; /* Gap between stat cards */
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color); /* Light border */
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex; /* Center icon */
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1rem;
}

.stat-info dt {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500; /* Medium font weight */
}

.stat-info dd {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Dashboard Sections */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Two-column layout */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.panel {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color); /* Light border */
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex; /* Flex for title and actions */
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Buttons & Links */
.btn-primary-custom {
    background: var(--primary);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border: none;
    cursor: pointer;
}

.btn-primary-custom:hover {
    background: var(--primary-hover);
}

/* Tables */
.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background: #f1f5f9;
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.custom-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #e0e7ff; color: #3730a3; }
.badge-danger { background: var(--danger); color: white; margin-left: auto; }

/* Charts */
.chart-box {
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .saas-sidebar { transform: translateX(-100%); }
    .saas-sidebar.active { transform: translateX(0); }
    .saas-main { margin-left: 0; }
    .dashboard-row { grid-template-columns: 1fr; }
}