/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1b1b18;
    background-color: #FDFDFC;
    min-height: 100vh;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0a0a0a;
        color: #EDEDEC;
    }
    
    .form-input[readonly] {
        background-color: #1a1a19 !important;
    }
    
    /* Order statuses container */
    #order-statuses-container {
        background-color: #1a1a19 !important;
        border-color: #3a3a39 !important;
    }
    
    #order-statuses-container .form-checkbox-text {
        color: #EDEDEC !important;
    }
    
    #order-statuses-container p {
        color: #9ca3af !important;
    }
    
    #order-statuses-loading {
        color: #9ca3af !important;
    }
    
    #order-statuses-error {
        color: #f87171 !important;
    }
    
    /* Load order statuses button */
    #load-order-statuses-btn {
        background-color: #3E3E3A !important;
        border-color: #3E3E3A !important;
        color: #EDEDEC !important;
    }
    
    #load-order-statuses-btn:hover {
        background-color: #4a4a46 !important;
        border-color: #4a4a46 !important;
    }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-col {
    flex-direction: column;
}

/* Navigation */
.nav {
    background: white;
    border-bottom: 1px solid #e3e3e0;
    padding: 1rem 0;
}

@media (prefers-color-scheme: dark) {
    .nav {
        background: #161615;
        border-color: #3E3E3A;
    }
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1b1b18;
    text-decoration: none;
}

@media (prefers-color-scheme: dark) {
    .nav-title {
        color: #EDEDEC;
    }
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user-text {
    font-size: 0.875rem;
}

@media (prefers-color-scheme: dark) {
    .nav-user-text {
        color: #EDEDEC;
    }
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: #1b1b18;
    color: white;
    border: 1px solid #1b1b18;
}

.btn-primary:hover {
    background-color: #000;
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 27, 24, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(27, 27, 24, 0.2);
}

@media (prefers-color-scheme: dark) {
    .btn-primary {
        background-color: #eeeeec;
        color: #1C1C1A;
        border-color: #eeeeec;
    }
    
    .btn-primary:hover {
        background-color: white;
        border-color: white;
        box-shadow: 0 4px 12px rgba(238, 238, 236, 0.3);
    }
}

.btn-secondary {
    background-color: transparent;
    color: #f53003;
    border: 1px solid #f53003;
}

.btn-secondary:hover {
    background-color: #1b1b18;
    color: white;
    border-color: #1b1b18;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 48, 3, 0.25);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(245, 48, 3, 0.2);
}

@media (prefers-color-scheme: dark) {
    .btn-secondary {
        color: #FF4433;
        border-color: #FF4433;
    }
    
    .btn-secondary:hover {
        background-color: #eeeeec;
        color: #1C1C1A;
        border-color: #eeeeec;
        box-shadow: 0 4px 12px rgba(255, 68, 51, 0.25);
    }
}

.btn-danger {
    background: linear-gradient(135deg, #f53003 0%, #d42800 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d42800 0%, #b82200 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 48, 3, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(245, 48, 3, 0.3);
}

@media (prefers-color-scheme: dark) {
    .btn-danger {
        background: linear-gradient(135deg, #FF4433 0%, #F61500 100%);
    }
    
    .btn-danger:hover {
        background: linear-gradient(135deg, #F61500 0%, #e01400 100%);
        box-shadow: 0 4px 12px rgba(255, 68, 51, 0.4);
    }
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
    .form-container {
        background: #161615;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
}

.form-group {
    margin-top: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

@media (prefers-color-scheme: dark) {
    .form-label {
        color: #EDEDEC;
    }
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e3e3e0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    color: #1b1b18;
}

.form-input:focus {
    outline: none;
    border-color: #f53003;
    box-shadow: 0 0 0 2px rgba(245, 48, 3, 0.1);
}

@media (prefers-color-scheme: dark) {
    .form-input {
        background: #161615;
        border-color: #3E3E3A;
        color: #EDEDEC;
    }
    
    .form-input:focus {
        border-color: #FF4433;
    }
}

.form-input-icon {
    position: relative;
}

.form-input-icon input {
    padding-left: 2.5rem;
}

.form-input-icon svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #706f6c;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .form-input-icon svg {
        color: #A1A09A;
    }
}

.form-checkbox-group {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.form-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0;
    width: fit-content;
}

.form-checkbox-group .form-help {
    margin-top: 0px;
}

.form-checkbox-label:hover .form-checkbox-text {
    color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .form-checkbox-label:hover .form-checkbox-text {
        color: #FF4433;
    }
}

.form-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    accent-color: #f53003;
    border: 2px solid #e3e3e0;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    transition: all 0.2s;
}

.form-checkbox:hover {
    border-color: #f53003;
}

.form-checkbox:checked {
    background-color: #f53003;
    border-color: #f53003;
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox:focus {
    outline: 2px solid #f53003;
    outline-offset: 2px;
    border-radius: 4px;
}

.form-checkbox-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1b1b18;
    line-height: 1.5;
    transition: color 0.2s;
}

@media (prefers-color-scheme: dark) {
    .form-checkbox {
        accent-color: #FF4433;
        border-color: #3E3E3A;
    }
    
    .form-checkbox:hover {
        border-color: #FF4433;
    }
    
    .form-checkbox:checked {
        background-color: #FF4433;
        border-color: #FF4433;
    }
    
    .form-checkbox:focus {
        outline-color: #FF4433;
    }
    
    .form-checkbox-text {
        color: #EDEDEC;
    }
}

/* Auth Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #FDFDFC 0%, #F9F9F8 50%, #F5F5F4 100%);
}

@media (prefers-color-scheme: dark) {
    .auth-container {
        background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 50%, #141414 100%);
    }
}

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

.auth-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f53003 0%, #d42800 100%);
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(245, 48, 3, 0.3);
}

.auth-logo-icon svg {
    width: 48px;
    height: 48px;
    color: white;
}

.auth-logo h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1b1b18;
}

@media (prefers-color-scheme: dark) {
    .auth-logo h1 {
        color: #EDEDEC;
    }
}

.auth-logo p {
    font-size: 0.875rem;
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .auth-logo p {
        color: #A1A09A;
    }
}

.auth-card {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .auth-card {
        background: #161615;
        border-color: #3E3E3A;
    }
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .auth-footer {
        border-color: #3E3E3A;
    }
}

.auth-footer p {
    font-size: 0.875rem;
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .auth-footer p {
        color: #A1A09A;
    }
}

.auth-footer a {
    color: #f53003;
    text-decoration: none;
    font-weight: 600;
}

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

@media (prefers-color-scheme: dark) {
    .auth-footer a {
        color: #FF4433;
    }
}

.auth-copyright {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .auth-copyright {
        color: #A1A09A;
    }
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-danger {
    background: #fff2f2;
    border-color: #f53003;
    color: #f53003;
}

.alert-error {
    background: #fff2f2;
    border-color: #f53003;
    color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .alert-danger,
    .alert-error {
        background: #1D0002;
        border-color: #F61500;
        color: #FF4433;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

.alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

@media (prefers-color-scheme: dark) {
    .alert-success {
        background: rgba(34, 197, 94, 0.1);
        border-color: #22c55e;
        color: #22c55e;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

.alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

@media (prefers-color-scheme: dark) {
    .alert-warning {
        background: rgba(245, 158, 11, 0.1);
        border-color: #f59e0b;
        color: #fbbf24;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

.alert-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0.25rem;
}

.alert-danger .alert-icon,
.alert-error .alert-icon {
    background: rgba(245, 48, 3, 0.1);
}

.alert-success .alert-icon {
    background: rgba(34, 197, 94, 0.1);
}

.alert-warning .alert-icon {
    background: rgba(245, 158, 11, 0.1);
}

@media (prefers-color-scheme: dark) {
    .alert-danger .alert-icon,
    .alert-error .alert-icon {
        background: rgba(255, 68, 51, 0.15);
    }
    
    .alert-success .alert-icon {
        background: rgba(34, 197, 94, 0.15);
    }

    .alert-warning .alert-icon {
        background: rgba(245, 158, 11, 0.15);
    }
}

.alert-icon svg {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-text {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    padding-top: 0.125rem;
}

.alert-content .alert-text:first-child {
    padding-top: 0;
}

/* Page Headings */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .page-title {
        color: #EDEDEC;
    }
}

.page-subtitle {
    font-size: 0.875rem;
    text-align: center;
    color: #706f6c;
    margin-bottom: 1.5rem;
}

@media (prefers-color-scheme: dark) {
    .page-subtitle {
        color: #A1A09A;
    }
}

/* Dashboard */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

@media (prefers-color-scheme: dark) {
    .dashboard-card {
        background: #161615;
    }
}

.dashboard-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
    .dashboard-title {
        color: #EDEDEC;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dashboard-box {
    padding: 1.5rem;
    border: 1px solid #e3e3e0;
    border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    .dashboard-box {
        border-color: #3E3E3A;
    }
}

.dashboard-box h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
    .dashboard-box h2 {
        color: #EDEDEC;
    }
}

.dashboard-box p {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    .dashboard-box p {
        color: #EDEDEC;
    }
}

.dashboard-box .font-medium {
    font-weight: 500;
}

/* Links */
.link {
    color: #f53003;
    text-decoration: none;
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .link {
        color: #FF4433;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.w-full {
    width: 100%;
}

.hidden {
    display: none;
}

.font-medium {
    font-weight: 500;
}

/* App Layout with Sidebar */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e3e3e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

@media (prefers-color-scheme: dark) {
    .sidebar {
        background: #161615;
        border-color: #3E3E3A;
    }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .sidebar-header {
        border-color: #3E3E3A;
    }
}

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

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f53003 0%, #d42800 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1b1b18;
}

@media (prefers-color-scheme: dark) {
    .sidebar-logo-text {
        color: #EDEDEC;
    }
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #706f6c;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-item:hover {
    background: #f5f5f5;
    color: #1b1b18;
    border-left-color: #f53003;
}

.sidebar-item.active {
    background: #fff2f2;
    color: #f53003;
    border-left-color: #f53003;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .sidebar-item {
        color: #A1A09A;
    }
    
    .sidebar-item:hover {
        background: #1a1a19;
        color: #EDEDEC;
        border-left-color: #FF4433;
    }
    
    .sidebar-item.active {
        background: #1D0002;
        color: #FF4433;
        border-left-color: #FF4433;
    }
}

.sidebar-divider {
    height: 1px;
    background: #e3e3e0;
    margin: 0.5rem 1.5rem;
}

@media (prefers-color-scheme: dark) {
    .sidebar-divider {
        background: #3E3E3A;
    }
}

.sidebar-section {
    margin-top: 0.5rem;
}

.sidebar-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .sidebar-section-title {
        color: #A1A09A;
    }
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .sidebar-footer {
        border-color: #3E3E3A;
    }
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .sidebar-user {
        border-color: #3E3E3A;
    }
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-avatar svg {
    width: 24px;
    height: 24px;
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .sidebar-user-avatar {
        background: #1a1a19;
    }
    
    .sidebar-user-avatar svg {
        color: #A1A09A;
    }
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1b1b18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-color-scheme: dark) {
    .sidebar-user-name {
        color: #EDEDEC;
    }
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: #706f6c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-color-scheme: dark) {
    .sidebar-user-email {
        color: #A1A09A;
    }
}

.sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid #e3e3e0;
    border-radius: 6px;
    color: #706f6c;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-logout svg {
    width: 18px;
    height: 18px;
}

.sidebar-logout:hover {
    background: #fff2f2;
    border-color: #f53003;
    color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .sidebar-logout {
        border-color: #3E3E3A;
        color: #A1A09A;
    }
    
    .sidebar-logout:hover {
        background: #1D0002;
        border-color: #FF4433;
        color: #FF4433;
    }
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background: white;
    border-bottom: 1px solid #e3e3e0;
    padding: 1.5rem 2rem;
}

@media (prefers-color-scheme: dark) {
    .main-header {
        background: #161615;
        border-color: #3E3E3A;
    }
}

.main-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1b1b18;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .main-header-title {
        color: #EDEDEC;
    }
}

.main-body {
    flex: 1;
    padding: 2rem;
    background: #FDFDFC;
}

@media (prefers-color-scheme: dark) {
    .main-body {
        background: #0a0a0a;
    }
}

/* Updated Dashboard Styles */
.dashboard-welcome {
    margin-bottom: 2rem;
}

.dashboard-box-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .dashboard-box-header {
        border-color: #3E3E3A;
    }
}

.dashboard-box-icon {
    width: 24px;
    height: 24px;
    color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .dashboard-box-icon {
        color: #FF4433;
    }
}

.dashboard-box-content {
    font-size: 0.875rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

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

@media (prefers-color-scheme: dark) {
    .info-item {
        border-color: #1a1a19;
    }
}

.info-label {
    font-weight: 500;
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .info-label {
        color: #A1A09A;
    }
}

.info-value {
    font-weight: 600;
    color: #1b1b18;
}

@media (prefers-color-scheme: dark) {
    .info-value {
        color: #EDEDEC;
    }
}

.stat-item {
    text-align: center;
    padding: 1rem;
    border: 1px solid #e3e3e0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.stat-item:last-child {
    margin-bottom: 0;
}

@media (prefers-color-scheme: dark) {
    .stat-item {
        border-color: #3E3E3A;
    }
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f53003;
    margin-bottom: 0.25rem;
}

@media (prefers-color-scheme: dark) {
    .stat-value {
        color: #FF4433;
    }
}

.stat-label {
    font-size: 0.875rem;
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .stat-label {
        color: #A1A09A;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-user {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* User Management Styles */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.users-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1b1b18;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .users-title {
        color: #EDEDEC;
    }
}

/* Filters */
.users-filters {
    background: white;
    border: 1px solid #e3e3e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

@media (prefers-color-scheme: dark) {
    .users-filters {
        background: #161615;
        border-color: #3E3E3A;
    }
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1b1b18;
}

@media (prefers-color-scheme: dark) {
    .filter-label {
        color: #EDEDEC;
    }
}

.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e3e3e0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #1b1b18;
}

.filter-input:focus {
    outline: none;
    border-color: #f53003;
    box-shadow: 0 0 0 3px rgba(245, 48, 3, 0.1);
}

@media (prefers-color-scheme: dark) {
    .filter-input {
        background: #1a1a19;
        border-color: #3E3E3A;
        color: #EDEDEC;
    }
    
    .filter-input:focus {
        border-color: #FF4433;
        box-shadow: 0 0 0 3px rgba(255, 68, 51, 0.1);
    }
}

.filters-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.filters-actions .filters-actions-left {
    display: flex;
    gap: 10px;
}

/* Users Table */
.users-table-wrapper {
    background: white;
    border: 1px solid #e3e3e0;
    border-radius: 8px;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .users-table-wrapper {
        background: #161615;
        border-color: #3E3E3A;
    }
}

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

.users-table thead {
    background: #f5f5f5;
}

@media (prefers-color-scheme: dark) {
    .users-table thead {
        background: #1a1a19;
    }
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1b1b18;
    border-bottom: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .users-table th {
        color: #EDEDEC;
        border-color: #3E3E3A;
    }
}

.users-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.sort-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.sort-link:hover {
    color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .sort-link:hover {
        color: #FF4433;
    }
}

.sort-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
}

.sort-link:hover .sort-icon {
    opacity: 1;
}

.sort-icon.sort-asc,
.sort-icon.sort-desc {
    opacity: 1;
    color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .sort-icon.sort-asc,
    .sort-icon.sort-desc {
        color: #FF4433;
    }
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #e3e3e0;
    font-size: 0.875rem;
    color: #1b1b18;
}

@media (prefers-color-scheme: dark) {
    .users-table td {
        color: #EDEDEC;
        border-color: #3E3E3A;
    }
}

.users-table tbody tr:hover {
    background: #f9f9f9;
}

@media (prefers-color-scheme: dark) {
    .users-table tbody tr:hover {
        background: #1a1a19;
    }
}

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

.text-muted {
    color: #706f6c;
}

@media (prefers-color-scheme: dark) {
    .text-muted {
        color: #A1A09A;
    }
}

.text-center {
    text-align: center;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-active {
    position: relative;
    width: 44px;
    height: 24px;
    appearance: none;
    background: #dbdbd7;
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-active:checked {
    background: #f53003;
}

@media (prefers-color-scheme: dark) {
    .toggle-active {
        background: #3E3E3A;
    }
    
    .toggle-active:checked {
        background: #FF4433;
    }
}

.toggle-active::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-active:checked::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #e3e3e0;
    border-radius: 6px;
    background: white;
    color: #706f6c;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-action svg {
    width: 16px;
    height: 16px;
}

.btn-action:hover {
    background: #f5f5f5;
    border-color: #1b1b18;
    color: #1b1b18;
}

.btn-edit:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

.btn-loyalty:hover {
    background: #fef3c7;
    border-color: #d97706;
    color: #d97706;
}

.btn-delete:hover {
    background: #fff2f2;
    border-color: #f53003;
    color: #f53003;
}

.btn-test-connection {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #3b82f6;
}

.btn-test-connection:hover {
    background-color: #dbeafe;
    color: #2563eb;
}

.btn-test-connection:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (prefers-color-scheme: dark) {
    .btn-action {
        background: #1a1a19;
        border-color: #3E3E3A;
        color: #A1A09A;
    }
    
    .btn-action:hover {
        background: #1a1a19;
        border-color: #EDEDEC;
        color: #EDEDEC;
    }
    
    .btn-edit:hover {
        background: rgba(2, 132, 199, 0.2);
        border-color: #0284c7;
        color: #0284c7;
    }
    
    .btn-loyalty:hover {
        background: rgba(217, 119, 6, 0.2);
        border-color: #d97706;
        color: #d97706;
    }
    
    .btn-delete:hover {
        background: #1D0002;
        border-color: #FF4433;
        color: #FF4433;
    }

    .btn-test-connection {
        color: #60a5fa;
    }

    .btn-test-connection:hover {
        background-color: rgba(59, 130, 246, 0.2);
        color: #3b82f6;
    }
}

.delete-form {
    display: inline;
}

/* Form Card */
.form-card {
    background: white;
    border: 1px solid #e3e3e0;
    border-radius: 8px;
    padding: 2rem;
}

@media (prefers-color-scheme: dark) {
    .form-card {
        background: #161615;
        border-color: #3E3E3A;
    }
}

.form-group-stack {
    display: flex;
    flex-direction: column;
}

.form-group-stack > div {
    display: flex;
    flex-direction: column;
}

.form-actions {
    display: flex;
    flex-direction: row !important;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-help {
    font-size: 0.75rem;
    color: #706f6c;
    margin-top: 0.25rem;
}

@media (prefers-color-scheme: dark) {
    .form-help {
        color: #A1A09A;
    }
}

/* Loyalty Card */
.loyalty-card {
    background: white;
    border: 1px solid #e3e3e0;
    border-radius: 8px;
    padding: 2rem;
}

@media (prefers-color-scheme: dark) {
    .loyalty-card {
        background: #161615;
        border-color: #3E3E3A;
    }
}

.loyalty-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e3e3e0;
}

@media (prefers-color-scheme: dark) {
    .loyalty-header {
        border-color: #3E3E3A;
    }
}

.loyalty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1b1b18;
    margin: 0 0 0.5rem 0;
}

@media (prefers-color-scheme: dark) {
    .loyalty-title {
        color: #EDEDEC;
    }
}

.loyalty-subtitle {
    font-size: 0.875rem;
    color: #706f6c;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .loyalty-subtitle {
        color: #A1A09A;
    }
}

.loyalty-total {
    text-align: right;
}

.loyalty-total-label {
    font-size: 0.75rem;
    color: #706f6c;
    margin-bottom: 0.25rem;
}

@media (prefers-color-scheme: dark) {
    .loyalty-total-label {
        color: #A1A09A;
    }
}

.loyalty-total-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .loyalty-total-value {
        color: #FF4433;
    }
}

.loyalty-info {
    margin-bottom: 2rem;
}

.loyalty-info-text {
    font-size: 1rem;
    color: #1b1b18;
    margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    .loyalty-info-text {
        color: #EDEDEC;
    }
}

.loyalty-info-note {
    font-size: 0.875rem;
    color: #706f6c;
    font-style: italic;
}

@media (prefers-color-scheme: dark) {
    .loyalty-info-note {
        color: #A1A09A;
    }
}

.loyalty-actions {
    display: flex;
    gap: 0.75rem;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination-wrapper nav {
    display: flex;
    gap: 0.5rem;
}

.pagination-wrapper a,
.pagination-wrapper span {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e3e3e0;
    border-radius: 6px;
    text-decoration: none;
    color: #1b1b18;
    background: white;
}

@media (prefers-color-scheme: dark) {
    .pagination-wrapper a,
    .pagination-wrapper span {
        border-color: #3E3E3A;
        color: #EDEDEC;
        background: #161615;
    }
}

.pagination-wrapper a:hover {
    background: #f5f5f5;
    border-color: #f53003;
}

@media (prefers-color-scheme: dark) {
    .pagination-wrapper a:hover {
        background: #1a1a19;
        border-color: #FF4433;
    }
}

.pagination-wrapper .active span {
    background: #f53003;
    border-color: #f53003;
    color: white;
}

@media (prefers-color-scheme: dark) {
    .pagination-wrapper .active span {
        background: #FF4433;
        border-color: #FF4433;
    }
}

/* Per Page Selector */
.per-page-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #706f6c;
    white-space: nowrap;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .per-page-label {
        color: #A1A09A;
    }
}

.per-page-select {
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 1px solid #e3e3e0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231b1b18' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    color: #1b1b18;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.per-page-select:hover {
    border-color: #f53003;
    box-shadow: 0 2px 4px rgba(245, 48, 3, 0.1);
}

.per-page-select:focus {
    outline: none;
    border-color: #f53003;
    box-shadow: 0 0 0 3px rgba(245, 48, 3, 0.1);
}

.per-page-select option {
    padding: 0.5rem;
    background: white;
    color: #1b1b18;
}

@media (prefers-color-scheme: dark) {
    .per-page-select {
        background: #161615;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23EDEDEC' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 12px;
        border-color: #3E3E3A;
        color: #EDEDEC;
    }
    
    .per-page-select:hover {
        border-color: #FF4433;
        box-shadow: 0 2px 4px rgba(255, 68, 51, 0.15);
    }
    
    .per-page-select:focus {
        border-color: #FF4433;
        box-shadow: 0 0 0 3px rgba(255, 68, 51, 0.1);
    }
    
    .per-page-select option {
        background: #161615;
        color: #EDEDEC;
    }
}

/* Badge */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
}

/* --- Loyalty Rules Section --- */
.loyalty-rules-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.loyalty-rules-header {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.75rem;
}

.loyalty-rules-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    flex-shrink: 0;
}

.loyalty-rules-icon svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.loyalty-rules-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    letter-spacing: -0.025em;
}

.loyalty-rules-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0.25rem 0 0 0;
}

.users-header-right > a > svg {
    vertical-align: sub;
}
