/* Global Reset & Base Variables */
:root {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --bg-color: #f8fafc;
    /* Slate 50 */
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --error-color: #ef4444;
    /* Red 500 */
    --success-color: #10b981;
    /* Emerald 500 */
    --radius-md: 8px;
    --radius-lg: 12px;
    --box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
    --bg-color: #0c0e12;
    --surface-color: #171c26;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #2d3748;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --primary-color: #818cf8;
}

/* Bootstrap Overrides */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.progress-bar {
    background-color: var(--primary-color) !important;
}

.progress {
    background-color: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Auth Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    background: var(--surface-color);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--box-shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: var(--surface-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-logo {
    max-width: 140px;
    margin-bottom: 1rem;
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

.business-name-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    letter-spacing: -0.01em;
}

.nav-menu {
    flex-grow: 1;
    padding: 1.5rem 0.75rem;
    list-style: none;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    color: var(--text-secondary);
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.925rem;
    border-radius: 10px;
    transition: var(--transition);
    gap: 0.75rem;
}

.nav-link svg {
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.05);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.nav-link.active svg {
    stroke: var(--primary-color);
    stroke-width: 2.5;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-color);
    color: var(--text-secondary);
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.nav-link.active .nav-badge {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    background: #D5EAFF;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: -2rem -2rem 2.5rem -2rem;
    border-radius: 0;
}

.topbar h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin: 0;
}

.topbar .agenda-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.topbar .admin-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.5);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.topbar .admin-profile .avatar {
    width: 38px;
    height: 38px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.topbar .admin-name {
    display: flex;
    flex-direction: column;
}

.topbar .admin-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.topbar .admin-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

[data-theme='dark'] .card:hover {
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.4);
}

/* Glassmorphism helpers */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme='dark'] .glass {
    background: rgba(23, 28, 38, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Dashboard */
@media (max-width: 900px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}