/* RoviBoot Admin Panel - CSS */

:root {
    --primary: #075E54;
    --primary-light: #128C7E;
    --primary-dark: #054D44;
    --accent: #25D366;
    --accent-light: #34eb7a;
    --bg: #f0f2f5;
    --bg-white: #ffffff;
    --text: #1a1a2e;
    --text-light: #667085;
    --border: #e4e7ec;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

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

.sidebar-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.sidebar-header .subtitle {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.nav-menu {
    list-style: none;
    padding: 12px 0;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    border-left-color: var(--accent);
    font-weight: 600;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.tab-content {
    display: none;
}

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

.tab-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary-dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s;
}

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

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    font-weight: 500;
}

/* Tables */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: var(--primary);
    color: white;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

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

.badge-active, .badge-sent, .badge-completed, .badge-valid { background: #dcfce7; color: #166534; }
.badge-pending, .badge-scheduled, .badge-draft { background: #fef3c7; color: #92400e; }
.badge-failed, .badge-cancelled, .badge-invalid { background: #fee2e2; color: #991b1b; }
.badge-link_generated, .badge-link_sent { background: #dbeafe; color: #1e40af; }
.badge-payment_confirmed, .badge-pdf_sent { background: #d1fae5; color: #065f46; }

/* Simulator */
.simulator-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.simulator-phone {
    width: 380px;
    min-width: 380px;
    background: #e5ddd5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: 680px;
}

.phone-header {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.phone-back { font-size: 20px; cursor: pointer; }
.phone-contact { display: flex; flex-direction: column; }
.phone-contact strong { font-size: 15px; }
.phone-contact small { font-size: 11px; opacity: 0.8; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="%23e5ddd5"/></svg>');
}

.message {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.bot-message {
    background: white;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.user-message {
    background: #dcf8c6;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.message-time {
    font-size: 10px;
    color: #999;
    float: right;
    margin-top: 4px;
    margin-left: 8px;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f0f0;
}

.phone-number-input {
    width: 130px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    outline: none;
}

.chat-input {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    outline: none;
}

.chat-input:focus { border-color: var(--primary); }

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.send-btn:hover { background: var(--primary-light); }
.send-btn:disabled { background: #ccc; cursor: not-allowed; }

.simulator-debug {
    flex: 1;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.simulator-debug h3 {
    margin-bottom: 16px;
    color: var(--primary);
}

.simulator-debug pre {
    background: #f1f5f9;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 12px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.settings-card h3 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 16px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.setting-item input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #f8fafc;
}

.setting-item small {
    font-size: 11px;
    color: var(--text-light);
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.template-item strong { font-size: 13px; }
.template-item p { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Buttons */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.actions-bar {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    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: var(--radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-message {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.modal-message.inbound {
    background: #dcf8c6;
    margin-right: 20%;
}

.modal-message.outbound {
    background: white;
    border: 1px solid var(--border);
    margin-left: 20%;
}

.modal-message .msg-meta {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header h1, .sidebar-header .subtitle, .nav-item span:not(.nav-icon) { display: none; }
    .nav-section-header { display: none; }
    .nav-product-item { padding-left: 16px; }
    .nav-item { justify-content: center; padding: 16px; }
    .main-content { margin-left: 60px; padding: 16px; }
    .simulator-container { flex-direction: column; }
    .simulator-phone { width: 100%; min-width: auto; }
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-card h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-card .subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 32px;
}

.login-card .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.login-card .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.login-card .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.login-card .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(7, 94, 84, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
    text-align: left;
}

/* User Info in Sidebar */
.user-info {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.user-info #user-display {
    opacity: 0.9;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.25);
}

/* Form Card (create user, etc.) */
.form-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.form-card h3 {
    color: var(--primary);
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.form-row .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.form-row .form-group input,
.form-row .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
}

.form-row .form-group input:focus,
.form-row .form-group select:focus {
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 4px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Role badges */
.badge-super_admin { background: #fae8ff; color: #86198f; }
.badge-admin { background: #dbeafe; color: #1e40af; }
.badge-viewer { background: #f0fdf4; color: #166534; }

/* ── Settings Tab (editable) ── */
.settings-subtitle {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 14px;
}

.settings-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.settings-status {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
}

.settings-status-success {
    background: #d5f5e3;
    color: #1e8449;
    border: 1px solid #82e0aa;
}

.settings-status-error {
    background: #fadbd8;
    color: #c0392b;
    border: 1px solid #f1948a;
}

.setting-desc {
    display: block;
    color: var(--text-light);
    font-size: 12px;
    margin-bottom: 6px;
}

.setting-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #fafbfc;
    transition: border-color 0.2s;
}

.setting-input:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(7, 94, 84, 0.1);
}

.input-with-toggle {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-toggle .setting-input {
    flex: 1;
}

.toggle-vis {
    padding: 8px 12px !important;
    font-size: 16px !important;
    min-width: 44px;
    cursor: pointer;
}

/* Toggle switch for boolean settings */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

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

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

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success);
}

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

#settings-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
}

#settings-groups .settings-card {
    margin-bottom: 0;
}

#settings-groups .settings-card h3 {
    color: var(--primary);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* ── Business Selector in Sidebar ── */
.business-selector {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.business-selector label {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
    color: white;
}

.business-selector select {
    width: 100%;
    padding: 6px 8px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.business-selector select option {
    background: var(--primary-dark);
    color: white;
}

.business-status {
    display: block;
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    color: white;
}

/* ── Nav separator ── */
.nav-separator {
    padding: 8px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    color: white;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 8px;
}

/* ── Nav section headers (grouped menu zones) ── */
.nav-section-header {
    padding: 12px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    opacity: 0.5;
    color: white;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 10px;
    list-style: none;
    cursor: default;
    user-select: none;
}

.nav-section-header:first-of-type {
    border-top: none;
    margin-top: 0;
}

/* Product-specific nav items (indented slightly) */
.nav-product-item {
    padding-left: 28px;
    font-size: 13px;
}

.nav-product-item .nav-icon {
    font-size: 14px;
    opacity: 0.8;
}

/* Product filter bar for Conversations / Orders */
.tab-filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tab-filter-bar label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

.tab-filter-bar select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
    min-width: 200px;
}

.tab-filter-bar select:focus {
    border-color: var(--primary);
}

/* ── Additional status badges ── */
.badge-suspended { background: #fef3c7; color: #92400e; }
.badge-archived { background: #e5e7eb; color: #374151; }
.badge-testing { background: #ede9fe; color: #5b21b6; }

/* ── Entity detail cards ── */
.entity-detail {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.entity-detail h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 15px;
}

.entity-detail .detail-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 13px;
}

.entity-detail .detail-label {
    font-weight: 600;
    color: var(--text-light);
    min-width: 140px;
}

.entity-detail .detail-value {
    color: var(--text);
}

/* ── JSON display ── */
.json-display {
    background: #f1f5f9;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}


/* ═══════════════════════════════════════════════════════
   Phase 3: Simulator config, Settings info, Assignment modal
   ═══════════════════════════════════════════════════════ */

.simulator-config {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.simulator-config .form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.simulator-config .form-group {
    flex: 1;
}

.sim-info-text {
    display: block;
    font-size: 0.85rem;
    color: #666;
    padding: 8px 0;
}

.settings-info-box {
    background: #e8f4fd;
    border: 1px solid #b3d9f2;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #1a5276;
}

/* Assignment detail modal */
.modal-lg {
    max-width: 800px;
    width: 90%;
}

.modal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 16px;
}

.modal-tab {
    padding: 8px 20px;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    transition: all 0.2s;
}

.modal-tab:hover {
    background: #e0e0e0;
}

.modal-tab.active {
    background: #0d6b4e;
    color: white;
}

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

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

.asgn-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.asgn-info-item {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.asgn-info-item label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.asgn-info-item span {
    font-weight: 500;
    color: #333;
}

.cred-field {
    margin-bottom: 12px;
}

.cred-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
}

.cred-field small {
    display: block;
    color: #888;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.cred-field .input-with-toggle {
    display: flex;
    gap: 4px;
}

.cred-field .setting-input {
    flex: 1;
}

/* ── Editable Modal Styles ── */

.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 8px 0;
}

.form-grid-2col .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.form-grid-2col .form-group input,
.form-grid-2col .form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.form-grid-2col .form-group input:read-only {
    background: #f5f5f5;
    color: var(--text-light);
}

.mono-textarea {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 0.85rem !important;
    line-height: 1.5;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    background: #fafafa;
}

.mono-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.modal-footer {
    padding: 16px 0 0;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.json-display {
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
    cursor: text;
    user-select: all;
}

/* Editable assignment info grid */
.asgn-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 8px 0;
}

.asgn-edit-grid .edit-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.asgn-edit-grid .edit-field input,
.asgn-edit-grid .edit-field select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
}

.asgn-edit-grid .edit-field.full-width {
    grid-column: 1 / -1;
}

.asgn-edit-grid .edit-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.4;
    resize: vertical;
    background: #fafafa;
}

.asgn-edit-grid .edit-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

@media (max-width: 768px) {
    .form-grid-2col,
    .asgn-edit-grid {
        grid-template-columns: 1fr;
    }
}

/* Toggle password visibility button */
.btn-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.btn-toggle-pass:hover {
    opacity: 1;
}
