:root {
    /* Premium Light Palette */
    --bg-body: #f4f4f5;
    /* Zinc 100 */
    --bg-card: #ffffff;
    /* White */
    --bg-sidebar: #ffffff;
    /* White */

    --text-primary: #18181b;
    /* Zinc 900 */
    --text-secondary: #52525b;
    /* Zinc 600 */
    --text-muted: #71717a;
    /* Zinc 500 */

    --primary: #4f46e5;
    /* Indigo 600 - slightly darker for contrast on white */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --primary-glow: rgba(79, 70, 229, 0.15);

    --border: #e4e4e7;
    /* Zinc 200 */
    --border-hover: #d4d4d8;
    /* Zinc 300 */

    --danger: #ef4444;
    --success: #10b981;

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --sidebar-width: 260px;
    --header-height: 64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #18181b;
    margin-bottom: 2.5rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}



.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.sidebar nav a:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.sidebar nav a.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.2);
}

.logout {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.logout a {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.logout a:hover {
    color: var(--danger);
    background: none;
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2.5rem;
    max-width: 1400px;
    margin-right: auto;
}

.page-header {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin: 0;
}

h2,
h3 {
    margin-top: 0;
    color: var(--text-primary);
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

/* Dashboard Grid */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(to bottom right, #ffffff, #f4f4f5);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s;
    font-family: inherit;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-hover);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    background-color: #ffffff;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger-text {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-danger-text:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
    font-size: 0.875rem;
}

th {
    background-color: #f4f4f5;
    /* Zinc 100 */
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-align: left;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Badges/Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--border);
    color: var(--text-secondary);
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top center, #f4f4f5, #e4e4e7);
}

.login-box {
    width: 100%;
    max-width: 400px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    /* More rounded */
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}



.error-msg {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    text-align: center;
}