/* Light Modern Grayscale Design System */
:root {
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --border-color: #e5e5e5;
    --border-focus: #111111;
    --btn-bg: #111111;
    --btn-hover: #333333;
    --btn-text: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 440px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
}

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

.logo-svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: var(--text-main);
    stroke-width: 2;
    margin-bottom: 12px;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

.app-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 6px;
}

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

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.text-input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.text-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.05);
}

/* Custom Suggestions Dropdown UI */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.suggestion-item:hover {
    background-color: #f7f7f7;
}

.suggestion-text {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
    flex-grow: 1;
    text-align: left;
}

.btn-remove-suggestion {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #c0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.btn-remove-suggestion:hover {
    color: #ff3b30;
    background-color: rgba(255, 59, 48, 0.08);
}

.btn-remove-suggestion svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.output-group {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.output-box {
    background: #fdfdfd;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.password-display {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    word-break: break-all;
    color: var(--text-main);
    min-height: 24px;
    user-select: all;
}

.password-display.placeholder {
    color: #b5b5b5;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0;
}

.password-display.loading {
    color: #777777;
    font-style: italic;
    font-family: var(--font-sans);
    font-weight: 500;
}

.btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--btn-hover);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #eaeaea;
    color: #a0a0a0;
    cursor: not-allowed;
    transform: none;
}

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

/* Password Metadata Panel styles */
.metadata-panel {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: left;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f4f4f4;
    padding-bottom: 6px;
}

.metadata-label {
    font-weight: 500;
}

.metadata-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-main);
}

.bruteforce-time {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    line-height: 1.5;
    color: var(--text-muted);
}

.bruteforce-time strong {
    color: var(--text-main);
    font-size: 0.95rem;
    display: inline-block;
    margin-top: 4px;
}

.footer-text {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 24px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-text a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

/* Toast Popup notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: var(--card-bg);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lockout screen specific */
.lockout-card .logo-svg {
    width: 48px;
    height: 48px;
    stroke: #ff3b30;
    margin-bottom: 16px;
}

.lockout-card .header {
    margin-bottom: 24px;
}

.lockout-card .app-title {
    font-size: 1.4rem;
}

/* Admin Toolbar & Role Badges */
.admin-toolbar {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.btn-admin-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-admin-pill:hover {
    border-color: var(--text-main);
    background: #f4f4f4;
}

.user-session-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 14px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.user-role-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    vertical-align: middle;
}

.badge-admin {
    background: var(--text-main);
    color: var(--card-bg);
}

.badge-user {
    background: #f0f0f0;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.user-email-text {
    color: var(--text-muted);
}

/* Secondary Button */
.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #cccccc;
}

/* Select Input Styling */
.select-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Modal Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    padding: 26px 28px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    animation: modalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
}

.modal-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.modal-subtitle code {
    font-family: var(--font-mono);
    color: var(--text-main);
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-field {
    margin-bottom: 14px;
}

.modal-field .form-label {
    margin-bottom: 6px;
}

.modal-field .text-input {
    padding: 10px 12px;
    font-size: 0.88rem;
}

.label-hint {
    font-weight: 400;
    text-transform: none;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.modal-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 0.82rem;
}

.modal-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}

.modal-alert.error {
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid #ff3b30;
    color: #ff3b30;
}

.modal-alert.success {
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid #34c759;
    color: #248a3d;
}

/* Wide Modal & Tabs */
.modal-card-wide {
    max-width: 580px;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.modal-tab-btn {
    background: none;
    border: none;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.modal-tab-btn:hover {
    color: var(--text-main);
    background: #f4f4f4;
}

.modal-tab-btn.active {
    background: var(--text-main);
    color: var(--card-bg);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

/* Domain Users Table */
.users-table-container {
    overflow-x: auto;
    max-height: 400px;
}

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

.users-table th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    white-space: nowrap;
}

.users-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.user-you-tag {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}

.user-status-pill {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.status-active {
    background: rgba(52, 199, 89, 0.1);
    color: #248a3d;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.status-locked {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.user-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-table-action {
    background: none;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-table-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-table-action.btn-edit {
    color: var(--text-main);
}

.btn-table-action.btn-edit:hover:not(:disabled) {
    background: var(--text-main);
    color: var(--card-bg);
    border-color: var(--text-main);
}

.btn-table-action.btn-unlock {
    color: #ff3b30;
    border-color: #ff3b30;
}

.btn-table-action.btn-unlock:hover:not(:disabled) {
    background: #ff3b30;
    color: #ffffff;
}

.btn-table-action.btn-lock {
    color: var(--text-muted);
}

.btn-table-action.btn-lock:hover:not(:disabled) {
    border-color: var(--text-main);
    color: var(--text-main);
}

.btn-table-action.btn-delete {
    color: #ff3b30;
    border-color: rgba(255, 59, 48, 0.35);
}

.btn-table-action.btn-delete:hover:not(:disabled) {
    background: #ff3b30;
    color: #ffffff;
    border-color: #ff3b30;
}

.text-input[readonly] {
    background-color: #f5f5f5;
    color: var(--text-muted);
    cursor: not-allowed;
}

.table-loading, .table-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
}



