/* Material Design Components CSS
 * Common styles for Material Design UI elements used throughout the application
 */

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    background-color: #f5f5f5;
    color: rgba(0, 0, 0, 0.87);
}

/* ===== LAYOUT COMPONENTS ===== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

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

.page-header.card {
    padding: 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    color: rgba(0, 0, 0, 0.87);
}

.page-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.875rem;
    margin: 4px 0 0 0;
}

/* ===== MATERIAL DESIGN CARDS ===== */
.mdc-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.mdc-card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.mdc-card-toolbar {
    margin-top: 16px;
}

.mdc-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: rgba(0, 0, 0, 0.87);
}

.mdc-card-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
}

/* ===== MATERIAL DESIGN FORM ELEMENTS ===== */
.mdc-text-field {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.mdc-text-field input,
.mdc-text-field select,
.mdc-text-field textarea {
    order: 1;
}

.mdc-text-field label {
    order: 2;
}

.mdc-text-field .form-help-text {
    order: 3;
    position: relative;
    margin-top: 6px;
}

.mdc-text-field input,
.mdc-text-field select,
.mdc-text-field textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.38);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    background: transparent;
    transition: border-color 0.2s ease;
}

.mdc-text-field input:focus,
.mdc-text-field select:focus,
.mdc-text-field textarea:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.mdc-text-field textarea {
    resize: vertical;
    min-height: 120px;
}

.mdc-text-field label {
    position: absolute;
    top: 16px;
    left: 16px;
    color: rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* Always keep labels floated for all Material UI text fields */
.mdc-text-field input + label,
.mdc-text-field select + label,
.mdc-text-field textarea + label {
    top: -8px;
    left: 12px;
    font-size: 0.75rem;
    background: white;
    padding: 0 4px;
    color: #1976d2;
}

/* ===== MATERIAL DESIGN BUTTONS ===== */
.mdc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 16px;
    height: 36px;
    border: none;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.0892857143em;
    text-decoration: none;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.mdc-button:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

.mdc-button.primary {
    background-color: #1976d2;
    color: white;
}

.mdc-button.primary:hover {
    background-color: #1565c0;
}

.mdc-button.secondary {
    background-color: #757575;
    color: white;
}

.mdc-button.secondary:hover {
    background-color: #616161;
}

.mdc-button.danger {
    background-color: #d32f2f;
    color: white;
}

.mdc-button.danger:hover {
    background-color: #b71c1c;
}

.mdc-button.warning {
    background-color: #f57c00;
    color: white;
}

.mdc-button.warning:hover {
    background-color: #ef6c00;
}

/* Button Groups */
.mdc-button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ===== MATERIAL DESIGN NOTIFICATION CARDS ===== */
.mdc-info-card {
    background: rgba(25, 118, 210, 0.04);
    border-left: 4px solid #1976d2;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.mdc-warning-card {
    background: rgba(245, 124, 0, 0.04);
    border-left: 4px solid #f57c00;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.mdc-error-card {
    background: rgba(211, 47, 47, 0.04);
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.mdc-success-card {
    background: rgba(56, 142, 60, 0.04);
    border-left: 4px solid #388e3c;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.mdc-info-card, .mdc-warning-card, .mdc-error-card, .mdc-success-card {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.mdc-info-card h4, .mdc-warning-card h4, .mdc-error-card h4, .mdc-success-card h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: rgba(0, 0, 0, 0.87);
}

.mdc-info-card p, .mdc-warning-card p, .mdc-error-card p, .mdc-success-card p {
    margin: 0 0 8px 0;
    color: rgba(0, 0, 0, 0.6);
}

/* ===== MATERIAL DESIGN DATA TABLE ===== */
.mdc-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

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

.mdc-data-table th,
.mdc-data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

.mdc-data-table th {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.87);
    background-color: #f5f5f5;
}

.mdc-data-table.blue-header th {
    background-color: #1976d2;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mdc-data-table.blue-header td {
    border-bottom: 1px solid rgba(224, 224, 224, 1);
}

.mdc-data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ===== MATERIAL DESIGN STATUS BADGES ===== */
.mdc-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.0892857143em;
}

.mdc-status-badge.active {
    background-color: rgba(56, 142, 60, 0.1);
    color: #2e7d32;
}

.mdc-status-badge.inactive {
    background-color: rgba(117, 117, 117, 0.1);
    color: #616161;
}

/* ===== MATERIAL DESIGN PERMISSION CHIPS ===== */
.mdc-permission-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    background-color: rgba(25, 118, 210, 0.1);
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== MATERIAL DESIGN DIALOG/MODAL ===== */
.mdc-modal,
.mdc-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.mdc-modal.show,
.mdc-dialog.show {
    opacity: 1;
    visibility: visible;
}

.mdc-modal-content,
.mdc-dialog-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 24px 38px rgba(0, 0, 0, 0.3), 0 9px 46px rgba(0, 0, 0, 0.22);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.mdc-modal-header,
.mdc-dialog-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.mdc-modal-title,
.mdc-dialog-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: rgba(0, 0, 0, 0.87);
    flex: 1;
    display: flex;
    align-items: center;
}

.mdc-modal-body,
.mdc-dialog-body {
    padding: 16px 24px;
}

.mdc-modal-footer,
.mdc-dialog-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Close button in modal header */
.mdc-modal-header .mdc-button,
.mdc-dialog-header .mdc-button {
    flex-shrink: 0;
}

.mdc-modal-header .mdc-button .material-icons,
.mdc-dialog-header .mdc-button .material-icons {
    margin: 0;
}

/* ===== FILE INPUT ===== */
.mdc-file-input {
    position: relative;
    display: inline-block;
    cursor: pointer;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.38);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.87);
}

.mdc-file-input:hover {
    border-color: #1976d2;
}

.mdc-file-input input[type="file"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* ===== LINKS ===== */
.mdc-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

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

/* ===== RESPONSE/LOG SECTIONS ===== */
.response-section, .log-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 16px;
    margin-top: 24px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.875rem;
}

.response-section h5, .response-section h4, .log-section h5, .log-section h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: rgba(0, 0, 0, 0.87);
}

/* ===== ALERT MESSAGES ===== */
.mdc-alert {
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    background: rgba(56, 142, 60, 0.08);
    border-left: 4px solid #388e3c;
    color: #2e7d32;
}

.mdc-alert i {
    margin-right: 12px;
    font-size: 20px;
}

/* ===== OPERATION TABS ===== */
.operation-tabs {
    display: flex;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    overflow: hidden;
}

.operation-tab {
    flex: 1;
    padding: 16px 24px;
    background: #f5f5f5;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.operation-tab:hover {
    background: #e8f5e8;
    color: rgba(0, 0, 0, 0.87);
}

.operation-tab.active {
    background: white;
    color: #1976d2;
    border-bottom-color: #1976d2;
    font-weight: 600;
}

.operation-tab i {
    display: block;
    font-size: 24px;
    margin-bottom: 4px;
}

/* ===== OPERATION CONTENT ===== */
.operation-content {
    display: none;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    padding: 24px;
}

.operation-content.active {
    display: block;
}

.operation-content .mdc-card {
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0;
    border: none;
}

.operation-content .mdc-card-header {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

/* ===== SEARCH COMPONENTS ===== */
.search-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.search-input {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 80px; /* Space for icons */
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.search-input input:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.search-input input::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

.search-icon {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.38);
    font-size: 20px;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.38);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
}

.search-clear:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.6);
}

.search-button {
    flex-shrink: 0;
    padding: 12px 16px;
    min-width: auto;
}

.search-button .material-icons {
    margin-right: 0;
}

.search-results-count, .total-users-count {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 400;
    margin-left: 8px;
}

.search-indicator {
    font-size: 0.8em;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 400;
}

/* ===== ACTION BUTTONS ===== */
.mdc-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mdc-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    outline: none;
}

.mdc-icon-button .material-icons {
    font-size: 20px;
    color: rgba(0, 0, 0, 0.54);
}

.mdc-icon-button:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.mdc-icon-button.edit-button:hover .material-icons {
    color: #f57c00;
}

.mdc-icon-button.delete-button:hover .material-icons {
    color: #d32f2f;
}

.mdc-icon-button:active {
    background-color: rgba(0, 0, 0, 0.08);
}

/* ===== TOOLTIPS ===== */
.mdc-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.87);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 8px;
}

.mdc-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.87);
}

.mdc-icon-button:hover .mdc-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
    display: flex;
    gap: 12px;
}

/* ===== MATERIAL DESIGN CHIPS ===== */
.mdc-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8125rem;
    font-weight: 400;
    height: 32px;
    background-color: rgba(25, 118, 210, 0.08);
    color: #1976d2;
}

.mdc-chip.primary {
    background-color: rgba(25, 118, 210, 0.08);
    color: #1976d2;
}

.mdc-chip.success {
    background-color: rgba(56, 142, 60, 0.08);
    color: #388e3c;
}

.mdc-chip.warning {
    background-color: rgba(245, 124, 0, 0.08);
    color: #f57c00;
}

.mdc-chip.info {
    background-color: rgba(0, 188, 212, 0.08);
    color: #00bcd4;
}

/* ===== LOADING STATES ===== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(25, 118, 210, 0.1);
    border-left: 4px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.875rem;
}

/* ===== FIELD DESCRIPTIONS AND VALIDATION ===== */
.mdc-field-description,
.field-description {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    margin-top: 4px;
}

.mdc-validation-error,
.validation-error {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #d32f2f;
    margin-top: 4px;
}

.mdc-required {
    color: #d32f2f;
}

/* ===== CONDITIONAL FIELDS ===== */
.conditional-field {
    display: none;
}

.conditional-field.show {
    display: block;
}

/* ===== FORM SECTIONS ===== */
/* Default minimal form section for Material Design forms */
.form-section {
    margin-bottom: 32px;
}

/* Styled form section variant for DCB config and other detailed forms */
.form-section.styled {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.form-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(0, 0, 0, 0.87);
}

.form-section.styled h4 {
    color: #007bff;
    margin-bottom: 20px;
}

/* ===== CHECKBOX GROUPS ===== */
.mdc-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mdc-checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.mdc-checkbox-item:hover {
    background: rgba(25, 118, 210, 0.04);
    border-color: #1976d2;
}

.mdc-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #1976d2;
}

.mdc-checkbox-item label {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.87);
    cursor: pointer;
    flex: 1;
}

.mdc-checkbox-item .permission-title {
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 2px;
}

.mdc-checkbox-item .permission-desc {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
}

/* ===== HELP TEXT ===== */
.mdc-help-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
    margin-top: 8px;
}

/* ===== FORM GROUP FOR SELECT FIELDS ===== */
.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.form-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.87);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.38);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.87);
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.form-select:disabled {
    background-color: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
}

/* Specific styling for select dropdowns */
select.form-select {
    cursor: pointer;
}

.form-help-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    margin-top: 6px;
    line-height: 1.4;
}

/* ===== MATERIAL DESIGN APP BAR ===== */
.mdc-app-bar {
    background-color: #1976d2;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 4;
}

.mdc-app-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.mdc-app-bar-brand {
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
    margin-right: 32px;
}

.mdc-app-bar-brand:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
}

.mdc-app-bar-brand i {
    margin-right: 12px;
    font-size: 1.5rem;
}

.mdc-app-bar-nav {
    display: flex;
    align-items: center;
    flex: 1;
}

.mdc-app-bar-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.mdc-app-bar-nav-item {
    margin: 0 8px;
}

.mdc-app-bar-nav-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.0892857143em;
}

.mdc-app-bar-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.mdc-app-bar-nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.mdc-app-bar-nav-link i {
    margin-right: 8px;
    font-size: 18px;
}

.mdc-app-bar-user {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.mdc-app-bar-organization {
    display: flex;
    align-items: center;
    margin-right: 24px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
}

.mdc-app-bar-organization i {
    margin-right: 8px;
}

.mdc-app-bar-user-menu {
    position: relative;
}

.mdc-app-bar-user-toggle {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: none;
    background: none;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mdc-app-bar-user-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mdc-app-bar-user-toggle i {
    margin-right: 8px;
}

.mdc-app-bar-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.mdc-app-bar-user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mdc-app-bar-user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.87);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    transition: background-color 0.2s ease;
}

.mdc-app-bar-user-dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: rgba(0, 0, 0, 0.87);
}

.mdc-app-bar-user-dropdown-item i {
    margin-right: 12px;
    color: rgba(0, 0, 0, 0.6);
}

.mdc-app-bar-mobile-toggle {
    display: none;
    border: none;
    background: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mdc-app-bar-mobile-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== LOGIN PAGE STYLES ===== */
body.login-page {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    background: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.logo-icon {
    font-size: 36px;
    color: white;
}

.app-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.form-section {
    padding: 32px 24px;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid #f44336;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: "⚠";
    margin-right: 12px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    position: absolute;
    top: 16px;
    left: 48px;
    font-size: 16px;
    font-weight: 400;
    color: #9e9e9e;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label .material-symbols-outlined {
    font-size: 20px;
    color: inherit;
}

.form-input {
    width: 100%;
    padding: 20px 16px 8px 48px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background-color: #fafafa;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #2196F3;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Always keep labels floated above inputs to avoid overlap */
body.login-page .form-label {
    top: -8px;
    left: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #2196F3;
    background: white;
    padding: 0 4px;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

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

.help-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.help-link:hover {
    color: white;
}

.help-link::before {
    content: "help";
    font-family: 'Material Symbols Outlined';
    margin-right: 4px;
    font-size: 16px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .page-container {
        padding: 16px;
    }

    .mdc-card {
        padding: 16px;
    }

    .mdc-data-table th,
    .mdc-data-table td {
        padding: 12px 8px;
    }

    .mdc-button-group {
        flex-direction: column;
    }

    .mdc-button-group .mdc-button {
        width: 100%;
    }

    .search-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-input {
        max-width: none;
    }

    .search-button {
        align-self: flex-start;
    }

    .mdc-action-buttons {
        justify-content: center;
    }

    .mdc-icon-button {
        width: 40px;
        height: 40px;
    }

    .mdc-checkbox-group {
        grid-template-columns: 1fr;
    }

    /* App Bar Mobile Styles */
    .mdc-app-bar-content {
        padding: 0 16px;
    }

    .mdc-app-bar-brand {
        font-size: 1.125rem;
        margin-right: 16px;
    }

    .mdc-app-bar-mobile-toggle {
        display: block;
        margin-left: auto;
    }

    .mdc-app-bar-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #1976d2;
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        display: none;
    }

    .mdc-app-bar-nav.show {
        display: flex;
    }

    .mdc-app-bar-nav-list {
        flex-direction: column;
        width: 100%;
    }

    .mdc-app-bar-nav-item {
        margin: 4px 0;
        width: 100%;
    }

    .mdc-app-bar-nav-link {
        justify-content: flex-start;
        width: 100%;
    }

    .mdc-app-bar-user {
        margin-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 16px;
        width: 100%;
    }

    .mdc-app-bar-organization {
        margin-right: 0;
        margin-bottom: 12px;
    }

    /* Login Page Mobile Styles */
    body.login-page .login-container {
        margin: 20px;
        max-width: none;
    }

    body.login-page .logo-section {
        padding: 30px 20px;
    }

    body.login-page .form-section {
        padding: 24px 20px;
    }
}

/* ===== TOGGLE SWITCH COMPONENT ===== */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    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: rgba(0, 0, 0, 0.38);
    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: #4caf50;
}

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

.toggle-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
}

.toggle-label.enabled {
    color: #4caf50;
}

.toggle-label.disabled {
    color: #757575;
}

/* ===== CHIP VARIANTS ===== */
.mdc-chip-blue {
    background: rgba(227, 242, 253, 1);
    color: #1976d2;
}

.mdc-chip-purple {
    background: rgba(243, 229, 245, 1);
    color: #7b1fa2;
}

.mdc-chip-green {
    background: rgba(232, 245, 233, 1);
    color: #2e7d32;
}

/* ===== TEXT VARIANTS ===== */
.text-monospace {
    font-family: 'Courier New', monospace;
}

.text-green {
    color: #2e7d32;
}

.text-muted {
    color: rgba(0, 0, 0, 0.6);
}

.text-muted-light {
    color: rgba(0, 0, 0, 0.5);
}

.text-warning {
    color: #f57c00;
}

.text-primary {
    color: #1976d2;
}

.text-uppercase {
    text-transform: uppercase;
}

/* ===== ICON SIZES ===== */
.icon-small {
    font-size: 14px;
}

.icon-medium {
    font-size: 18px;
}

.icon-large {
    font-size: 48px;
}

/* ===== SPACING UTILITIES ===== */
.margin-right-xs {
    margin-right: 4px;
}

.margin-right-sm {
    margin-right: 8px;
}

.margin-right-md {
    margin-right: 12px;
}

.margin-right-lg {
    margin-right: 16px;
}

.margin-bottom-xs {
    margin-bottom: 4px;
}

.margin-bottom-sm {
    margin-bottom: 8px;
}

.margin-bottom-md {
    margin-bottom: 12px;
}

.margin-bottom-lg {
    margin-bottom: 16px;
}

.margin-top-xs {
    margin-top: 4px;
}

.margin-top-sm {
    margin-top: 8px;
}

.margin-top-md {
    margin-top: 12px;
}

.margin-top-lg {
    margin-top: 16px;
}

/* ===== ALIGNMENT UTILITIES ===== */
.vertical-middle {
    vertical-align: middle;
}

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

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    font-size: 48px;
    color: rgba(0, 0, 0, 0.38);
    margin-bottom: 16px;
}

.empty-state-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
}

.empty-state-subtext {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.5);
    margin: 8px 0 0 0;
}

.empty-state-link {
    color: #1976d2;
    text-decoration: none;
}

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

/* ===== TABLE UTILITIES ===== */
.table-responsive {
    overflow-x: auto;
}

.table-cell-muted {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s;
}

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

.autocomplete-item:hover {
    background-color: rgba(25, 118, 210, 0.08);
}

.autocomplete-item-main {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.87);
    margin-bottom: 4px;
}

.autocomplete-item-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: rgba(0, 0, 0, 0.6);
}

.autocomplete-loading,
.autocomplete-error,
.autocomplete-empty {
    padding: 16px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.autocomplete-error {
    color: #d32f2f;
}

.autocomplete-loading .material-icons.rotating {
    animation: rotate 1s linear infinite;
}

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

/* Selected customer display box */
.selected-customer-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(25, 118, 210, 0.08);
    border: 1px solid rgba(25, 118, 210, 0.3);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.selected-customer-box strong {
    color: rgba(0, 0, 0, 0.87);
    font-size: 0.9375rem;
    font-weight: 500;
}

.customer-id-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    background: rgba(25, 118, 210, 0.12);
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

.clear-customer-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.54);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.clear-customer-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.87);
}

.clear-customer-btn .material-icons {
    font-size: 20px;
}