@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Refined SaaS Palette */
    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --brand-secondary: #0f172a;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-heading: #1e293b;
    --text-body: #475569;
    --text-muted: #94a3b8;
    --border-subtle: #f1f5f9;
    --border-default: #e2e8f0;
    
    /* Semantic Colors */
    --status-success-bg: #f0fdf4;
    --status-success-text: #166534;
    --status-warning-bg: #fffbeb;
    --status-warning-text: #92400e;
    --status-danger-bg: #fef2f2;
    --status-danger-text: #991b1b;
    
    /* Layout Constants */
    --sidebar-width: 280px;
    --header-height: 72px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Auth Experience --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    padding: 24px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 48px;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-box h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    text-align: center;
}

.login-box p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
    font-size: 0.9375rem;
}

/* --- Core App Layout --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--brand-secondary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    padding: 32px 20px;
    z-index: 100;
}

.sidebar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    margin-bottom: 48px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand::before {
    content: '';
    width: 32px;
    height: 32px;
    background: var(--brand-primary);
    border-radius: 8px;
    display: inline-block;
}

.sidebar ul {
    list-style: none;
    flex: 1;
}

.sidebar ul li {
    margin-bottom: 4px;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.9375rem;
}

.sidebar ul li a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar ul li a.active {
    background: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-bottom: 48px;
}

.top-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-title {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.875rem;
    opacity: 0.7;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-default);
    border-radius: 99px;
    font-size: 0.875rem;
}

.content-body {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Dash Components --- */
h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.025em;
    margin-bottom: 32px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
}

/* --- Tables & Lists --- */
.container-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 16px 32px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

td {
    padding: 20px 32px;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border-subtle);
}

tr:hover td {
    background: #fbfcfe;
}

/* --- Buttons & Inputs --- */
.btn {
    font-family: inherit;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.24);
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    background: white;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* --- Badges --- */
.status-badge {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active { background: var(--status-success-bg); color: var(--status-success-text); }
.status-pending { background: var(--status-warning-bg); color: var(--status-warning-text); }

footer {
    padding: 40px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 32px 12px; }
    .sidebar-brand::before { width: 40px; }
    .sidebar-brand span { display: none; }
    .sidebar ul li span { display: none; }
    .main-content { margin-left: 80px; }
}
