/* BrickMaster Pro - Full Scale Enterprise SaaS Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* DEFAULT DARK MODE THEME SYSTEM */
    --bg-main: #131324;        /* Dark Slate Canvas (Matches Flutter app primaryDark) */
    --bg-card: rgba(30, 30, 47, 0.65); /* Glass card canvas */
    --bg-sidebar: #1E1E2F;     /* Deep dark sidebar (Matches Flutter app sidebarBackground) */
    --bg-navbar: rgba(19, 19, 36, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-dimmed: #64748B;
    --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    /* Branding Colors */
    --color-primary: #8D0F2E;   /* Maroon (Matches Flutter app primaryMaroon) */
    --color-secondary: #A23B55; /* Rose-maroon variation */
    --color-accent: #EC407A;    /* Pink Accent */
    --color-success: #16A34A;   /* Success Green */
    --color-warning: #F59E0B;   /* Warning Amber */
    --color-danger: #EF4444;    /* Danger Red */
    
    --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* LIGHT THEME SYSTEM (Toggled via .light-theme class on body) */
body.light-theme {
    --bg-main: #F5F7FA;        /* Light Canvas (Matches Flutter app canvasLight) */
    --bg-card: rgba(255, 255, 255, 0.9); /* Opaque white card canvas */
    --bg-sidebar: #FFFFFF;     /* White sidebar */
    --bg-navbar: rgba(245, 247, 250, 0.8);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.16);
    
    --text-primary: #131324;
    --text-secondary: #475569;
    --text-dimmed: #94A3B8;
    --shadow-main: 0 20px 45px -15px rgba(15, 23, 42, 0.12);
    --shadow-glass: 0 8px 30px 0 rgba(15, 23, 42, 0.06);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
body.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.3; }
}
@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.animate-fade {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Skeletons Loader */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 6px;
}
body.light-theme .skeleton {
    background: linear-gradient(90deg, rgba(15,23,42,0.02) 25%, rgba(15,23,42,0.06) 50%, rgba(15,23,42,0.02) 75%);
    background-size: 200% 100%;
}

/* Status Badges */
.badge {
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}
.badge-online, .badge-active, .badge-success {
    background: rgba(22, 163, 74, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(22, 163, 74, 0.25);
}
.badge-offline, .badge-inactive, .badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-suspended, .badge-expired, .badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-pending, .badge-processing {
    background: rgba(244, 162, 97, 0.15);
    color: var(--color-accent);
    border: 1px solid rgba(244, 162, 97, 0.25);
}

/* LAYOUT STRUCTURE */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR REDESIGNED */
.sidebar {
    width: 260px;
    height: 100vh;
    max-height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition-smooth);
    z-index: 40;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: radial-gradient(circle at top left, rgba(141, 15, 46, 0.12), transparent 70%);
    pointer-events: none;
}

body.light-theme .sidebar::before {
    background: radial-gradient(circle at top left, rgba(141, 15, 46, 0.04), transparent 70%);
}

.sidebar.collapsed {
    width: 78px;
}

.sidebar-header {
    height: 70px;
    flex-shrink: 0;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    background: var(--bg-sidebar);
    position: relative;
    z-index: 10;
}

.sidebar-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(141, 15, 46, 0.25);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-brand-logo:hover {
    transform: scale(1.08) rotate(-5deg);
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.sidebar.collapsed .sidebar-brand-text {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Section Labels */
.sidebar-section-label {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dimmed);
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.sidebar.collapsed .sidebar-section-label {
    opacity: 0;
    padding: 0;
    height: 0;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1 1 0px !important;
    min-height: 0 !important;
    padding: 0.5rem 0.75rem 2.5rem 0.75rem !important;
    list-style: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(141, 15, 46, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(141, 15, 46, 0.2);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.sidebar-nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
}

.sidebar-nav-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    margin-right: 0.75rem;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-nav-link svg {
    margin-right: 0;
}

.sidebar-nav-link span {
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-nav-link span {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sidebar-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

body.light-theme .sidebar-nav-link:hover {
    background: rgba(15, 23, 42, 0.04);
}

.sidebar-nav-link:hover svg {
    transform: scale(1.1) rotate(-6deg);
    stroke: var(--color-primary);
}

.sidebar-nav-link.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px -6px rgba(141, 15, 46, 0.5) !important;
    border: 1px solid rgba(141, 15, 46, 0.2) !important;
    transform: none !important;
}

.sidebar-nav-link.active svg {
    stroke: #ffffff !important;
}

.sidebar-nav-link.active::after {
    content: '';
    position: absolute;
    right: 14px;
    width: 5px;
    height: 5px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffffff;
}

.sidebar.collapsed .sidebar-nav-link.active::after {
    display: none;
}

/* User Card Redesigned */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glass);
    transition: border-color 0.3s;
}

.sidebar-user-card:hover {
    border-color: var(--border-hover);
}

body.light-theme .sidebar-user-card {
    background: rgba(15, 23, 42, 0.02);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(141, 15, 46, 0.2);
}

.sidebar-user-details {
    flex-grow: 1;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.sidebar.collapsed .sidebar-user-details,
.sidebar.collapsed .sidebar-user-logout {
    display: none;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.sidebar-user-logout {
    color: var(--text-dimmed);
    transition: var(--transition-smooth);
    padding: 0.25rem;
    border-radius: 0.35rem;
}

.sidebar-user-logout:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.08);
}

/* NAVBAR REDESIGNED */
.navbar {
    height: 70px;
    background: var(--bg-navbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.navbar-collapse-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
body.light-theme .navbar-collapse-btn:hover {
    background: rgba(15,23,42,0.04);
}

/* Breadcrumbs */
.breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dimmed);
}

.breadcrumb-trail a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}
.breadcrumb-trail a:hover {
    color: var(--color-primary);
}

.breadcrumb-separator {
    color: var(--text-dimmed);
    font-size: 0.75rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Global Navbar buttons */
.nav-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
body.light-theme .nav-action-btn {
    background: rgba(15,23,42,0.02);
}

.nav-action-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.05);
}
body.light-theme .nav-action-btn:hover {
    background: rgba(15,23,42,0.05);
}

.nav-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Notification bell badge */
.bell-btn-wrapper {
    position: relative;
}
.bell-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-danger);
    border: 2px solid var(--bg-main);
}

/* Notification Dropdown Drawer */
.notifications-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 350px;
    max-width: calc(100vw - 2rem);
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    border-radius: 14px;
    display: none;
    overflow: hidden;
    z-index: 999999 !important;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme .notifications-dropdown {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

.notifications-dropdown.active {
    display: block;
}

.notif-header {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.03);
}

body.light-theme .notif-header {
    background: #f8fafc;
}

.notif-list {
    max-height: 280px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

.notif-item {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.light-theme .notif-item:hover {
    background: #f1f5f9;
}

.notif-item-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.notif-item-time {
    font-size: 0.72rem;
    color: var(--text-dimmed);
    margin-top: 0.35rem;
}

.notif-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

body.light-theme .notif-footer {
    background: #f8fafc;
}

.notif-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
}

/* PREMIUM CARDS */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-glass);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.panel:hover {
    border-color: var(--border-hover);
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.panel-body {
    padding: 1.5rem;
}

/* ENTERPRISE DATA GRID (Redesigned Tables) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 0 0 20px 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.table th {
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.01);
    position: sticky;
    top: 0;
    z-index: 5;
    user-select: none;
}
body.light-theme .table th {
    background: rgba(15,23,42,0.01);
}

.table td {
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    transition: var(--transition-smooth);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}
body.light-theme .table tr:hover td {
    background: rgba(15, 23, 42, 0.015);
}

/* Table sorting caret */
.sort-header {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.sort-header:hover {
    color: var(--text-primary);
}
.sort-caret {
    font-size: 0.65rem;
    color: var(--text-dimmed);
}

/* Checkbox Row selection */
.table-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Bulk Actions Slide-up Drawer */
.bulk-actions-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 150%);
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--color-primary);
    box-shadow: var(--shadow-glow), 0 10px 40px rgba(0,0,0,0.5);
    border-radius: 14px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 45;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bulk-actions-bar.active {
    transform: translate(-50%, 0);
}

.bulk-actions-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-accent);
}

/* Grid Pagination Footer */
.table-pagination-row {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.pagination-btn-group {
    display: flex;
    gap: 0.35rem;
}

/* PREMIUM FORMS & FLOATING LABELS */
.form-input-wrapper {
    position: relative;
    margin-bottom: 1.25rem;
    width: 100%;
}

.form-icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dimmed);
    pointer-events: none;
    transition: var(--transition-smooth);
    width: 18px;
    height: 18px;
}

.form-input-field {
    width: 100%;
    height: 56px;
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1rem 0.5rem 16px; /* Default left padding */
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}
body.light-theme .form-input-field {
    background-color: rgba(15, 23, 42, 0.015);
}

/* Custom Select dropdown arrow styling */
select.form-input-field {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px !important;
}

body.light-theme select.form-input-field {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Style HTML Select Option Tags to prevent white-on-white native OS rendering issues */
select.form-input-field option,
select.premium-input option,
select option {
    background-color: #111827; /* Dark background matching --bg-card */
    color: #FFFFFF;            /* Solid white text */
}

body.light-theme select.form-input-field option,
body.light-theme select.premium-input option,
body.light-theme select option {
    background-color: #FFFFFF; /* White background for light theme */
    color: #0F172A;            /* Dark Slate text */
}

.form-input-field:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    background-color: rgba(255, 255, 255, 0.03);
}
body.light-theme .form-input-field:focus {
    background-color: rgba(15, 23, 42, 0.02);
}

.form-input-label {
    position: absolute;
    left: 16px; /* Default left offset */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dimmed);
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: none;
    transition: var(--transition-smooth);
}

/* If the input wrapper has a left icon, indent the input and label */
.form-input-wrapper:has(.form-icon-left) .form-input-field {
    padding-left: 44px;
}
.form-input-wrapper:has(.form-icon-left) .form-input-label {
    left: 44px;
}

.form-input-field:focus ~ .form-input-label,
.form-input-field:not(:placeholder-shown) ~ .form-input-label,
select.form-input-field ~ .form-input-label {
    top: 10px;
    font-size: 0.72rem;
}

.form-input-field:focus ~ .form-input-label,
select.form-input-field:focus ~ .form-input-label {
    color: var(--color-accent);
}

.form-input-field:focus ~ .form-icon-left {
    color: var(--color-primary);
}

.form-helper-text {
    font-size: 0.75rem;
    color: var(--text-dimmed);
    margin-top: 0.35rem;
    display: block;
}

/* Steppers Wizard Modal Navigation */
.wizard-stepper-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.01);
}
body.light-theme .wizard-stepper-progress {
    background: rgba(15, 23, 42, 0.01);
}

.wizard-step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    flex-grow: 1;
}

.wizard-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 2px solid var(--border-color);
    color: var(--text-dimmed);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 2;
}

.wizard-step-node.active .wizard-step-circle {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(201, 106, 43, 0.4);
}

.wizard-step-node.completed .wizard-step-circle {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.wizard-step-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dimmed);
    letter-spacing: 0.05em;
    text-align: center;
}
.wizard-step-node.active .wizard-step-label {
    color: var(--color-accent);
}

.wizard-step-node::after {
    content: '';
    position: absolute;
    height: 2px;
    background: var(--border-color);
    width: 100%;
    left: 50%;
    top: 14px;
    z-index: 1;
}
.wizard-step-node:last-child::after {
    display: none;
}

.wizard-step-node.completed::after {
    background: var(--color-success);
}

/* Modal form wizard step panels visibility */
.wizard-step-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}
.wizard-step-panel.active {
    display: block;
}

.modal-sticky-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255,255,255,0.015);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
body.light-theme .modal-sticky-footer {
    background: rgba(15, 23, 42, 0.015);
}

/* BUTTONS DESIGN SYSTEM */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(201, 106, 43, 0.2);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 106, 43, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color);
}
body.light-theme .btn-secondary {
    background: rgba(15, 23, 42, 0.04);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}
body.light-theme .btn-secondary:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.08);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) {
    background: var(--color-danger);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}
body.light-theme .btn-ghost:hover:not(:disabled) {
    background: rgba(15,23,42,0.03);
}

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

/* ANALYTIC WIDGETS & TELEMETRY */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .telemetry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .telemetry-grid {
        grid-template-columns: 1fr;
    }
}

.telemetry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glass);
    transition: var(--transition-smooth);
}
.telemetry-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.telemetry-indicator-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 106, 43, 0.08) 0%, transparent 70%);
    top: -50px;
    right: -50px;
    pointer-events: none;
}

.telemetry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.telemetry-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dimmed);
}

.telemetry-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.telemetry-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }

/* Interactive SVG Charts */
.analytics-chart-panel {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-svg-container {
    flex-grow: 1;
    width: 100%;
    margin-top: 1.5rem;
}

.chart-line {
    stroke: var(--color-primary);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 6px 12px rgba(201,106,43,0.3));
}

.chart-area {
    fill: url(#chartAreaGrad);
}

.chart-grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
}

.chart-dot {
    fill: var(--bg-main);
    stroke: var(--color-accent);
    stroke-width: 3;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.chart-dot:hover {
    r: 7;
    fill: var(--color-primary);
}

/* Empty / Error state overlays */
.empty-state-card {
    padding: 3.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.empty-state-illustration {
    width: 140px;
    height: 140px;
    margin-bottom: 0.5rem;
    color: var(--text-dimmed);
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.empty-state-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.5;
}

/* 404 / 500 error display structure */
.error-page-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--bg-main);
}

.error-page-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 480px;
    box-shadow: var(--shadow-main);
    animation: fadeIn 0.5s ease forwards;
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

/* Profile Layout structure */
.profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.profile-sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    align-self: start;
}

.profile-avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2.2rem;
    color: #fff;
    margin: 0 auto 1.25rem auto;
    border: 3px solid rgba(255,255,255,0.06);
}

.profile-menu-list {
    list-style: none;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.profile-menu-item a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-smooth);
}
.profile-menu-item a:hover, .profile-menu-item.active a {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
body.light-theme .profile-menu-item a:hover, body.light-theme .profile-menu-item.active a {
    background: rgba(15,23,42,0.04);
}
.profile-menu-item.active a {
    color: var(--color-primary);
    background: rgba(201, 106, 43, 0.08) !important;
}

/* PREMIUM MODAL DIALOG DESIGN SYSTEM */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(7, 11, 20, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main), 0 20px 50px rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-dimmed);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 6px;
    transition: var(--transition-smooth);
}
.btn-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
body.light-theme .btn-close:hover {
    background: rgba(15,23,42,0.04);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Password Generator inline field */
.password-generator-field {
    position: relative;
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    width: 100%;
}

.password-generator-field .form-input-field {
    flex: 1;
    margin-bottom: 0;
}

.password-generator-field .btn {
    height: 56px;
    white-space: nowrap;
    padding: 0 1.25rem;
    border-radius: 12px;
}

/* RESPONSIVE DESIGN SYSTEM OVERRIDES */
@media (max-width: 1024px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        width: 280px !important;
        top: 0 !important;
        bottom: 0 !important;
        z-index: 99999 !important;
        box-shadow: 5px 0 25px rgba(0,0,0,0.15);
    }
    .sidebar.active {
        left: 0 !important;
    }
    .sidebar.collapsed {
        width: 280px !important;
        left: -280px !important;
    }
    .sidebar.collapsed.active {
        left: 0 !important;
    }
    .navbar-collapse-btn {
        display: block !important;
        z-index: 100000 !important;
    }
}

/* PREMIUM SPLIT SCREEN LOGIN & FORGOT PASSWORD PAGE LAYOUTS */
.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    width: 100vw;
    background-color: #0F172A;
    overflow: hidden;
    animation: fadeIn 0.5s ease-out forwards;
}

/* Left panel (60%) */
.login-left-panel {
    width: 60%;
    background-color: #0B0F19;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.login-left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(255,255,255,0.015) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(201, 106, 43, 0.2);
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.72rem;
    color: var(--text-dimmed);
    font-weight: 600;
}

.factory-illustration-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-height: 440px;
    z-index: 10;
    margin: 2rem 0;
}

.factory-svg {
    width: 100%;
    max-width: 520px;
    height: auto;
    display: block;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--color-accent);
    border-radius: 50%;
    opacity: 0.3;
}

.feature-info-area {
    z-index: 10;
}

.headline-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}
.headline-text span {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature-list-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.feature-check-icon {
    width: 20px;
    height: 20px;
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.feature-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.left-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
    z-index: 10;
}

.security-badge-group {
    display: flex;
    gap: 1.25rem;
}

.security-badge-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dimmed);
}
.security-badge-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Right panel (40%) */
.login-right-panel {
    width: 40%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.right-panel-header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.lang-selector-wrapper {
    position: relative;
}

.lang-select {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem 0.5rem 0.75rem;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: var(--transition-smooth);
}
.lang-select:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.glass-login-card {
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-main);
    animation: fadeIn 0.4s ease-out forwards;
}

.glass-login-card.shake {
    animation: shake 0.4s ease-in-out;
}

.login-card-header {
    margin-bottom: 1.75rem;
}

.login-card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.login-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Premium Inputs */
.premium-input-wrapper {
    position: relative;
    margin-bottom: 1.25rem;
    width: 100%;
}

.input-icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dimmed);
    pointer-events: none;
    width: 18px;
    height: 18px;
    transition: var(--transition-smooth);
}

.premium-input {
    width: 100%;
    height: 56px;
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1rem 0.5rem 44px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition-smooth);
}
body.light-theme .premium-input {
    background-color: rgba(15, 23, 42, 0.015);
}

.premium-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    background-color: rgba(255, 255, 255, 0.03);
}

.premium-input-label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dimmed);
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.premium-input:focus ~ .premium-input-label,
.premium-input:not(:placeholder-shown) ~ .premium-input-label {
    top: 12px;
    font-size: 0.72rem;
    color: var(--color-accent);
}

.premium-input:focus ~ .input-icon-left {
    color: var(--color-primary);
}

.password-toggle-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dimmed);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.password-toggle-btn:hover {
    color: #fff;
}

.form-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.checkbox-container input {
    accent-color: var(--color-primary);
    cursor: pointer;
}

.forgot-link {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition-smooth);
}
.forgot-link:hover {
    text-decoration: underline;
    color: #fff;
}

.btn-premium-login {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(201, 106, 43, 0.2);
    transition: var(--transition-smooth);
}
.btn-premium-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 106, 43, 0.35);
}
.btn-premium-login:active {
    transform: translateY(0);
}

.spinner-icon {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.support-link-block {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-dimmed);
    font-weight: 600;
}
.support-link-block a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition-smooth);
}
.support-link-block a:hover {
    color: var(--color-primary);
}

.right-panel-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-dimmed);
    font-weight: 600;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
}

/* Standalone Forgot Password Screen Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--bg-main);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    font-size: 0.75rem;
    color: var(--text-dimmed);
    font-weight: 600;
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* RESPONSIVE ADJUSTMENTS FOR SPLIT LAYOUT */
@media (max-width: 1024px) {
    .login-left-panel {
        display: none;
    }
    .login-right-panel {
        width: 100%;
        min-height: 100vh;
        padding: 2rem;
    }
    .glass-login-card {
        margin: 2rem 0;
    }
}

/* Premium Alert Banners */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}
.alert-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--color-success);
    border-color: rgba(22, 163, 74, 0.2);
}
body.light-theme .alert-success {
    background: rgba(22, 163, 74, 0.08);
    color: #15803d; /* High-contrast green for Light Mode */
    border-color: rgba(22, 163, 74, 0.2);
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.2);
}
body.light-theme .alert-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c; /* High-contrast red for Light Mode */
    border-color: rgba(239, 68, 68, 0.2);
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    min-width: 0;
}

.content-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .content-body {
        padding: 1.25rem;
    }
}

/* ============================================
   ACTION BUTTONS (TABLE ROW ACTIONS)
   ============================================ */
.actions-btn-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition-smooth);
}
body.light-theme .btn-icon {
    background: rgba(15, 23, 42, 0.03);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}
body.light-theme .btn-icon:hover {
    background: rgba(15, 23, 42, 0.07);
}

.btn-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: var(--color-danger) !important;
}

/* ============================================
   TOAST NOTIFICATION SYSTEM
   ============================================ */
.toast-msg {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-primary);
    color: var(--text-primary);
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-main);
    animation: fadeIn 0.3s ease-out forwards;
    max-width: 320px;
    line-height: 1.4;
}

/* ============================================
   CODE TAG STYLING
   ============================================ */
code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.12rem 0.45rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    color: var(--color-accent);
    word-break: break-all;
}
body.light-theme code {
    background: rgba(15, 23, 42, 0.05);
    color: var(--color-secondary);
}

/* ============================================
   BADGE ROLE VARIANT
   ============================================ */
.badge-role {
    background: rgba(244, 162, 97, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(244, 162, 97, 0.25);
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.badge-role::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

/* ============================================
   BTN-BLOCK UTILITY
   ============================================ */
.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* ============================================
   FORM GROUP SPACER
   ============================================ */
.form-group:last-child {
    margin-bottom: 0;
}

/* ============================================
   PROGRESS BAR COMPONENT
   ============================================ */
.progress-bar-track {
    height: 6px;
    border-radius: 99px;
    background: var(--border-color);
    overflow: hidden;
    flex-grow: 1;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* ============================================
   SHADOW GLOW (was missing from variables)
   ============================================ */
:root {
    --shadow-glow: 0 0 0 3px rgba(201, 106, 43, 0.15);
}

/* ============================================
   RESPONSIVE TABLE FIX
   ============================================ */
@media (max-width: 768px) {
    .table {
        font-size: 0.78rem;
    }
    .table td, .table th {
        padding: 0.75rem 0.85rem;
    }
}

/* ============================================
   SIDEBAR AUDIT LINK FIX
   ============================================ */
.sidebar-nav-link.active svg {
    stroke: var(--color-primary);
}

/* ============================================
   MOBILE SIDEBAR BACKDROP & RESPONSIVENESS
   ============================================ */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 35;
    animation: fadeIn 0.25s ease-out;
}
.sidebar-backdrop.active {
    display: block;
}

@media (max-width: 768px) {
    .breadcrumb-trail {
        display: none !important;
    }
    .navbar {
        padding: 0 1rem;
    }
    .content-body {
        padding: 0.75rem !important;
    }
    .panel-body {
        padding: 1rem !important;
    }
    .panel-header {
        padding: 1rem !important;
    }
    .type-card, .detail-card, .ledger-balance-card, .factory-header-panel, .supplier-header-panel, .transporter-header-panel {
        padding: 1.25rem !important;
        border-radius: 12px !important;
    }
    .type-add-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    .type-add-row button {
        width: 100% !important;
        height: 48px !important;
    }
    .card-item, .thekedar-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    .card-item-left, .thekedar-card-left {
        width: 100% !important;
    }
    .card-item-right, .thekedar-card-right {
        width: 100% !important;
        justify-content: space-between !important;
        border-top: 1px dashed var(--border-color) !important;
        padding-top: 0.75rem !important;
    }
    .payment-mode-group {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .payments-list-footer, .selling-list-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        text-align: center !important;
    }
    .ledger-action-bar {
        grid-template-columns: 1fr !important;
    }
    .factory-header-panel, .supplier-header-panel, .transporter-header-panel {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: left !important;
        gap: 0.75rem !important;
    }
    .factory-header-panel div, .supplier-header-panel div, .transporter-header-panel div {
        text-align: left !important;
    }
    .table-responsive {
        border: none !important;
        overflow-x: visible !important;
    }
    .table, .table tbody, .table tr, .table td {
        display: block !important;
        width: 100% !important;
    }
    .table thead {
        display: none !important;
    }
    .table tr {
        margin-bottom: 1.25rem !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 14px !important;
        background: var(--bg-card) !important;
        padding: 0.5rem 0 !important;
        box-shadow: var(--shadow-glass) !important;
        overflow: hidden;
    }
    .table td {
        text-align: right !important;
        padding: 0.75rem 1.25rem !important;
        border-bottom: 1px dashed var(--border-color) !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 0.85rem !important;
    }
    .table td:last-child {
        border-bottom: none !important;
        background: rgba(255,255,255,0.01) !important;
        padding-top: 0.85rem !important;
        padding-bottom: 0.85rem !important;
    }
    body.light-theme .table td:last-child {
        background: rgba(15,23,42,0.01) !important;
    }
    .table td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-dimmed);
        text-align: left;
        padding-right: 15px;
    }
}

