.login-page {
    display: flex;
    min-height: 100vh;
}

.login-brand {
    flex: 1;
    background: linear-gradient(135deg, #1e243d 0%, #0f1225 50%, #1a1040 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.login-brand::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    border-radius: 50%;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.login-brand-icon svg {
    width: 36px;
    height: 36px;
}

.login-brand-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.login-brand-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.7;
}

.login-brand-features {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-brand-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.login-brand-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-brand-feature-icon svg {
    width: 18px;
    height: 18px;
    color: #818cf8;
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #ffffff;
}

.login-form-card {
    width: 100%;
    max-width: 380px;
}

.login-form-header {
    margin-bottom: 36px;
}

.login-form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.login-form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-password-wrapper {
    position: relative;
}

.login-password-wrapper .form-input {
    padding-right: 44px;
}

.login-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.login-password-toggle:hover {
    color: var(--text-secondary);
}

.login-password-toggle svg {
    width: 18px;
    height: 18px;
}

.login-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
}

.login-btn.loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-btn .btn-text {
    transition: opacity 0.2s;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn .btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    opacity: 0;
    transition: opacity 0.2s;
}

.login-btn.loading .btn-spinner {
    opacity: 1;
}

.login-form-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .login-brand {
        display: none;
    }

    .login-form-side {
        background: var(--bg);
    }
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 24px;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 36px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

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

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.dash-stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.25s ease;
}

.dash-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dash-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.dash-stat-icon.indigo {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.dash-stat-icon.emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.dash-stat-icon.amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.dash-stat-icon.rose {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.dash-stat-icon.cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.dash-stat-info {
    flex: 1;
    min-width: 0;
}

.dash-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.quick-action-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
    color: var(--text);
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--text);
}

.quick-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-light);
}

.quick-action-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.quick-action-text {
    font-size: 14px;
    font-weight: 600;
}

.quick-action-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tab-nav {
    display: flex;
    gap: 8px;
    padding: 0;
    flex: 1;
}

.tab-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid transparent;
}

.tab-nav-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.tab-nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-light);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.device-toolbar {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 0;
}

.device-tab-panel {
    padding: 20px 24px 24px;
}

.device-filter-row {
    justify-content: flex-start;
    margin-bottom: 16px;
}

.device-filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.device-sort-input {
    width: 56px;
    height: 28px;
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.device-sort-input:focus {
    border-color: #4f46e5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.tab-add-btn {
    margin-left: auto;
}

.case-form {
    max-width: 100%;
}

.pagination-top {
    margin-top: 20px;
}

.toolbar-mb {
    margin-bottom: 20px;
}
