/* CRM/Product Management Tool - Styles */

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --gold-color: #fbbf24;
    --grey-color: #9ca3af;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark-bg);
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100; /* Lower than modals (10000) */
}

.sidebar-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    color: var(--grey-color);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link i {
    margin-right: 12px;
    font-size: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
}

/* Role badge - color set dynamically via inline style */
.user-badge.role-badge {
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Organization badge */
.user-badge.org-badge {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    text-transform: none;
    font-weight: 500;
}

/* Branch badge */
.user-badge.branch-badge {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    text-transform: none;
    font-weight: 500;
}

/* Legacy badges - keep for backwards compatibility */
.user-badge.cpe {
    background: var(--gold-color);
    color: var(--dark-bg);
}

.user-badge.non-cpe {
    background: var(--grey-color);
    color: white;
}

/* User name styling */
.user-name {
    font-weight: 500;
    margin-right: 12px;
}

.btn-logout {
    padding: 8px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #dc2626;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Tables */
.data-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.search-box {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

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

.btn-secondary:hover {
    background: #6d28d9;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

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

.data-table thead {
    background: var(--light-bg);
}

.data-table th {
    padding: 15px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    position: sticky;
    top: 0;
    background: var(--light-bg);
    z-index: 10;
}

.data-table td {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--light-bg);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-frozen {
    background: #dbeafe;
    color: #1e40af;
}

.badge-expired {
    background: #fee2e2;
    color: #991b1b;
}

.badge-master-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-branch-admin {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-alpha-plus {
    background: #fce7f3;
    color: #831843;
}

.badge-alpha {
    background: #ddd6fe;
    color: #5b21b6;
}

.badge-beta {
    background: #ccfbf1;
    color: #115e59;
}

.badge-gamma {
    background: #fef9c3;
    color: #854d0e;
}

.badge-base {
    background: #f3f4f6;
    color: #374151;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Enhanced select styling for hardware management */
select.form-input {
    appearance: none;
    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='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select.form-input option {
    padding: 10px;
}

select.form-input optgroup {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    padding: 8px 12px;
}

select.form-input optgroup option {
    font-weight: 400;
    color: #1f2937;
    padding-left: 20px;
}

/* Hardware user checkbox labels */
.user-checkbox-label {
    transition: background-color 0.2s;
}

.user-checkbox-label:hover {
    background-color: #f9fafb !important;
}

.user-checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* Hardware tab buttons */
.hw-tab-btn {
    transition: all 0.2s;
}

.hw-tab-btn:hover {
    color: #6366f1 !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    cursor: pointer;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

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

.login-box .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 6px;
    font-size: 12px;
}

.demo-credentials h4 {
    margin-bottom: 10px;
    font-size: 14px;
}

.demo-credentials p {
    margin: 5px 0;
}

/* Detail View */
.detail-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.detail-header .button-group {
    display: flex;
    gap: 10px;
}

.detail-header .button-group button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.detail-header .btn-edit {
    background: #7c3aed;
    color: white;
    border: none;
}

.detail-header .btn-edit:hover {
    background: #6d28d9;
}

.detail-header .btn-save {
    background: #10b981;
    color: white;
    border: none;
}

.detail-header .btn-save:hover {
    background: #059669;
}

.detail-header .btn-cancel {
    background: #6b7280;
    color: white;
    border: none;
}

.detail-header .btn-cancel:hover {
    background: #4b5563;
}

.detail-title h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    overflow: hidden;
}

.detail-item label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.detail-item .value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
    overflow-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
}

/* Editable field styles */
.detail-item input[type="text"],
.detail-item input[type="email"],
.detail-item input[type="tel"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.detail-item input[type="text"]:focus,
.detail-item input[type="email"]:focus,
.detail-item input[type="tel"]:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* International phone input styling */
.detail-item .iti {
    width: 100%;
    position: relative;
}

.detail-item .iti__input {
    width: 100%;
    padding: 8px 10px 8px 52px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
}

.detail-item .iti__input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.detail-item .iti__flag-container {
    border-right: 1px solid #ddd;
}

.detail-item .iti__selected-flag {
    padding: 0 8px;
}

.detail-item .iti__country-list {
    position: absolute;
    z-index: 10000;
    max-height: 200px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 2px;
    background-color: #ffffff;
}

.detail-item .iti__country {
    background-color: #ffffff;
}

.detail-item .iti__country:hover {
    background-color: #f5f5f5;
}

.detail-item .iti__country.iti__highlight {
    background-color: #7c3aed;
    color: white;
}

.detail-item .iti__search-input {
    background-color: #ffffff;
    border: 1px solid #ddd;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure detail-item doesn't clip the dropdown */
.detail-item.editable {
    overflow: visible;
}

.detail-grid {
    overflow: visible;
}

.detail-item.editable {
    background: #fff;
    border: 1px solid #e0e0e0;
}

.detail-item.editable label {
    color: #7c3aed;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

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

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

.flex {
    display: flex;
}

.gap-10 {
    gap: 10px;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}
/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e5e7eb;
    margin: 20px 0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color);
    background: #f9fafb;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Org Chart Placeholder */
.org-chart-placeholder {
    padding: 40px;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.org-chart-placeholder h4 {
    margin-bottom: 10px;
    color: #111827;
}

.org-chart-placeholder p {
    color: #6b7280;
    margin: 5px 0;
}

/* View ID Button */
.btn-view-id {
    background: #6366f1;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 5px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-view-id:hover {
    background: #4f46e5;
}

.btn-view-id i {
    font-style: normal;
    font-size: 14px;
}

/* Branch header with View ID button */
.branch-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.branch-header h5 {
    margin: 0;
}

/* Modal Overlay - Proper positioning and z-index */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Higher than sidebar */
    padding: 20px;
}

.modal-overlay .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
}

.modal-overlay .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.modal-overlay .modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-overlay .modal-body {
    padding: 24px;
}

.modal-overlay .modal-body p {
    margin: 0 0 16px 0;
    color: #374151;
}

.modal-overlay .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.modal-overlay .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-overlay .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-overlay .btn-primary {
    background: #6366f1;
    color: white;
}

.modal-overlay .btn-primary:hover {
    background: #4f46e5;
}

.modal-overlay .btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.modal-overlay .btn-secondary:hover {
    background: #d1d5db;
}

.modal-overlay .btn-danger {
    background: #ef4444;
    color: white;
}

.modal-overlay .btn-danger:hover {
    background: #dc2626;
}

/* Close modal when clicking outside */
.modal-overlay:not(.no-close-on-backdrop) {
    cursor: pointer;
}

.modal-overlay .modal-content {
    cursor: default;
}

/* ============================================
   POLICY MANAGEMENT STYLES
   ============================================ */

.policy-container {
    padding: 20px;
}

.policy-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.section-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
}

.alert-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.alert-config-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alert-header h4 {
    margin: 0;
    color: #374151;
    font-size: 16px;
}

.alert-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
}

.alert-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.alert-options input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #3b82f6;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Link */
.btn-link {
    background: none;
    border: none;
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

.btn-link:hover {
    color: #2563eb;
}

/* Icon Button */
.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

/* Form Groups */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-group small {
    color: #6b7280;
    font-size: 12px;
    margin-left: 5px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: #374151;
    background: #f9fafb;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* New User Modal Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.required {
    color: #ef4444;
    font-weight: bold;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

#branch-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    background: #f9fafb;
}

.btn-success {
    background: #10b981;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-danger:disabled {
    background: #fca5a5;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Modal header padding adjustments */
.modal-header {
    padding: 15px 20px !important;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .alert-config-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        white-space: nowrap;
    }
}

/* ============================================
   LOCATION LISTS STYLES
   ============================================ */

.location-lists-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.list-tab {
    min-width: 180px;
    padding: 12px 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.list-tab:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.list-tab.active {
    background: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.list-tab-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.list-tab-count {
    font-size: 12px;
    color: #6b7280;
}

.list-tab-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.btn-icon-small {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-icon-small:hover {
    opacity: 1;
}

.list-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.list-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.list-content-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
}

.color-option {
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

/* Responsive Design for Lists */
@media (max-width: 768px) {
    .location-lists-tabs {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .list-tab {
        min-width: 150px;
    }
    
    .list-content-header {
        flex-direction: column;
        gap: 15px;
    }
}

/* Hardware info icon tooltip */
.info-icon {
    display: inline-block;
    cursor: help;
    margin-left: 5px;
    color: #6b7280;
    font-size: 14px;
    transition: color 0.2s;
}

.info-icon:hover {
    color: #3b82f6;
}

/* Copy button styles */
.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    margin-left: 4px;
    opacity: 0.6;
    transition: all 0.2s;
    vertical-align: middle;
}

.copy-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Toast notification styles */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-error {
    background: #ef4444;
}

/* Side panel for hardware details */
.side-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.side-panel.open {
    right: 0;
}

.side-panel-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 20px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.side-panel-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.side-panel-content {
    padding: 20px;
}

.detail-section-header {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 20px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.detail-section-header:first-child {
    margin-top: 0;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 10px;
}

.detail-label {
    font-weight: 500;
    color: #6b7280;
    min-width: 180px;
    flex-shrink: 0;
    font-size: 13px;
}

.detail-value {
    color: #1f2937;
    word-break: break-word;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Responsive side panel */
@media (max-width: 768px) {
    .side-panel {
        width: 100%;
        right: -100%;
    }
}


/* Info Card Styles for Hardware Management */
.info-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.info-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Modal User Item Styles */
.modal-user-item {
    transition: background-color 0.2s;
}

.modal-user-item:hover {
    background-color: #f9fafb !important;
}

.modal-user-branch-group {
    margin-bottom: 15px;
}

/* Hardware Organization Assignment Modal */
.org-list-item {
    transition: background 0.2s, border-left 0.2s;
}

.org-list-item:hover {
    background: #f9fafb !important;
}

.org-list-item.selected {
    background: #eff6ff !important;
    border-left: 4px solid #2563eb;
}

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

/* Notification Badge Styles */
.notification-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.notification-badge-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.notification-badge-inactive {
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
}

.notification-badge-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.notification-badge-mini.notification-badge-active {
    background: #dcfce7;
    border: 1px solid #86efac;
}

.notification-badge-mini.notification-badge-inactive {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    opacity: 0.6;
}

/* ============================================================================
   ORGANIZATION NOTES STYLES
   ============================================================================ */

.notes-container {
    max-width: 900px;
}

.note-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.note-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.note-meta {
    flex: 1;
}

.note-author {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.note-date {
    font-size: 13px;
    color: #6b7280;
}

.note-edited {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    font-style: italic;
}

.note-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.note-content {
    color: #1f2937;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Note History Styles */
.history-container {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.history-date {
    font-size: 13px;
    color: #6b7280;
}

.history-changes {
    font-size: 14px;
    color: #374151;
}

.history-changes > div {
    margin-bottom: 8px;
}

.history-text {
    margin-top: 12px;
}

.previous-text {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Additional Badge Colors */
.badge-purple {
    background-color: #f3e8ff;
    color: #7e22ce;
}

.badge-cyan {
    background-color: #cffafe;
    color: #0e7490;
}

/* Info Box */
.info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    color: #0c4a6e;
    line-height: 1.6;
}

/* ============================================================================
   ADMIN FORMS STYLES (WR04 & System Admin)
   ============================================================================ */

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-details {
    font-size: 14px;
    line-height: 1.8;
}

.form-details h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.form-details p {
    margin: 8px 0;
    color: #1f2937;
}

.form-details strong {
    color: #6b7280;
    font-weight: 500;
}

.additional-admin {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    background: #f9fafb;
}

.additional-admin h4 {
    margin-bottom: 15px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Button-style tabs (for specific use cases like policy tabs) */
.tab-buttons .tab-button {
    padding: 10px 20px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.tab-buttons .tab-button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.tab-buttons .tab-button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Badge variations for form status */
.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #cfe2ff;
    color: #084298;
}

.badge-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-danger {
    background-color: #f8d7da;
    color: #842029;
}

/* Notification badge for sidebar */
.sidebar-notification-badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* Unread indicator badge for forms */
.unread-badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Unread dot indicator (more subtle) */
.unread-dot {
    color: #3b82f6;
    font-size: 16px;
    font-weight: bold;
    margin-right: 4px;
    vertical-align: middle;
}

/* Unread reason badge (shows icon for what changed) */
.unread-reason-badge {
    display: inline-block;
    font-size: 16px;
    margin-right: 4px;
    vertical-align: middle;
    cursor: help;
}

/* Form sections container */
.forms-sections-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.forms-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.forms-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.forms-section-content {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.forms-section-content::-webkit-scrollbar {
    width: 8px;
}

.forms-section-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.forms-section-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.forms-section-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.empty-section-message {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}
/* ============================================================
   NOTE BADGE STYLES
   Add these styles to your styles.css file
   ============================================================ */

/* Base badge styling */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid transparent;
}

/* Badge variations for note types and statuses */
.badge-primary {
    background-color: #cfe2ff;
    color: #084298;
    border-color: #9ec5fe;
}

.badge-secondary {
    background-color: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

.badge-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #a3cfbb;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffe69c;
}

.badge-info {
    background-color: #cfe2ff;
    color: #084298;
    border-color: #9ec5fe;
}

.badge-danger {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f1aeb5;
}

.badge-purple {
    background-color: #f3e8ff;
    color: #7e22ce;
    border-color: #e9d5ff;
}

.badge-cyan {
    background-color: #cffafe;
    color: #0e7490;
    border-color: #a5f3fc;
}

/* Note card specific styling */
.note-card .badge {
    margin-right: 8px;
    font-size: 10px;
    padding: 3px 10px;
}

.note-card .note-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Color Legend for Note Types:
   - Gray (secondary): General notes
   - Blue (info): Information changes
   - Yellow (warning): Upcoming issues
   - Blue (primary): Renewals
   - Green (success): Billing
   - Purple: Support requests
   - Cyan: Technical issues
*/

/* Color Legend for Note Status:
   - Green (success): Active
   - Red (danger): Flagged - needs attention
   - Yellow (warning): Pending - in progress
   - Gray (secondary): Resolved - completed
*/