/* ══════════════════════════════════════════════════════════
   PAGE-SPECIFIC STYLES
   ══════════════════════════════════════════════════════════ */

/* ── Login Page ────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background);
    color: var(--foreground);
    padding: 1rem;
    position: relative;
    overflow: hidden;
    transition: background-color var(--transition-speed);
}

.login-container {
    width: 100%;
    max-width: 400px; /* slightly narrower card feels more compact */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.15rem;
    color: var(--foreground);
    opacity: 0.9;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

/* Specific Input Overrides for Login Page */
.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-form .form-label {
    font-size: 0.813rem; /* slightly smaller label */
    font-weight: 600;
}

.login-form .form-label span {
    color: var(--destructive);
    margin-left: 2px;
}

.login-form .form-input {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.938rem;
    transition: all 0.2s;
}

.login-form .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
    outline: none;
}

/* Purple Accent Button - Refactored to match dashboard theme */
.btn-accent {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 0.75rem;
    padding: 0.5rem;
    font-size: 0.938rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
    width: 100%;
}

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

.btn-accent:active {
    transform: translateY(0);
}

.btn-accent:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Secondary/Social Button Wrap */
.login-divider {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0.25rem 0;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    gap: 1rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.btn-secondary-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
    border-radius: 0.75rem;
    padding: 0.55rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-outline:hover {
    background-color: var(--secondary);
}

.google-btn-wrapper:hover .btn-secondary-outline {
    background-color: var(--secondary);
}

.google-btn-wrapper:focus-within .btn-secondary-outline {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

.login-footer {
    margin-top: 0.25rem;
    font-size: 0.813rem;
    color: var(--muted-foreground);
}

.login-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-error {
    color: var(--destructive);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    min-height: 1.25rem;
}

.login-warning {
    color: var(--warning);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: none;
}

/* ── Role-based visibility ─────────────────────────────── */
.admin-only, .super-admin-only { display: none; }

body.role-admin .admin-only,
body.role-super_admin .admin-only,
body.role-super_admin .super-admin-only { display: block; }

li.admin-only, li.super-admin-only { display: none; }
body.role-admin li.admin-only,
body.role-super_admin li.admin-only,
body.role-super_admin li.super-admin-only { display: block; }

/* ── Connection Status Bar ─────────────────────────────── */
.connection-bar {
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.813rem;
    font-weight: 500;
    display: none;
}

.connection-bar.offline {
    display: block;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--destructive);
    border-bottom: 1px solid var(--destructive);
}

.connection-bar.reconnecting {
    display: block;
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* ── Page Transitions ──────────────────────────────────── */
#page-content {
    animation: fadeIn 0.2s ease;
}

/* ── Inventory Grid Legend ─────────────────────────────── */
.grid-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.grid-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ── Checkbox label styles ─────────────────────────────── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }

/* ── Dashboard Page Compact Optimization ────────────────── */
.main-content.page-active-dashboard {
    padding: 1.25rem 1.5rem !important;
}

.dashboard-viewport-wrapper .page-title {
    font-size: 1.625rem !important;
    margin-bottom: 0.25rem !important;
}

.dashboard-viewport-wrapper .page-description {
    font-size: 0.875rem !important;
}

.dashboard-viewport-wrapper .overview-card {
    padding: 1rem 1.25rem !important;
}

.dashboard-viewport-wrapper .overview-value {
    font-size: 1.75rem !important;
    margin-bottom: 0.25rem !important;
}

.dashboard-viewport-wrapper .overview-label {
    font-size: 0.8rem !important;
}

.dashboard-viewport-wrapper .overview-change {
    margin-top: 0.25rem !important;
    padding: 0.15rem 0.4rem !important;
    font-size: 0.8rem !important;
}

/* ── Clickable user links and rows in User Management ───── */
.user-link {
    color: var(--primary) !important;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.user-link:hover {
    color: var(--primary-hover) !important;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.clickable-row-item {
    cursor: pointer;
    transition: color 0.15s ease;
}

.clickable-row-item:hover {
    color: var(--primary);
}

.user-avatar-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.user-avatar-clickable:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

