@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --color-bg: #f5f6fa;
    --color-surface: #ffffff;
    --color-surface-hover: #f8f9fc;
    --color-border: #e2e5f1;
    --color-border-light: #eef0f6;
    --color-text: #1a1d2e;
    --color-text-secondary: #6b7194;
    --color-text-muted: #9da3c0;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #eef2ff;
    --color-primary-ring: rgba(79, 70, 229, 0.15);
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-light: #fef2f2;
    --color-success: #10b981;
    --color-success-light: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-light: #fffbeb;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.1);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ LOADING OVERLAY ============ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 246, 250, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner .spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
}

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

/* ============ LOGIN PAGE ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f6fa 0%, #eef2ff 50%, #f5f6fa 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    padding: 36px 40px 32px;
    text-align: center;
}

.login-header .brand-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
}

.login-header .brand-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.login-header h1 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
}

.login-body {
    padding: 36px 40px 40px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.form-group input::placeholder {
    color: var(--color-text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: #cdd1e0;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    padding: 8px 12px;
}

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

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.dashboard-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-header .brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-header .brand-logo svg {
    width: 20px;
    height: 20px;
    color: white;
}

.dashboard-header .brand h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.3px;
}

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

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-right: 8px;
}

.header-user .avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.header-user .user-info {
    display: flex;
    flex-direction: column;
}

.header-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
}

.header-user .user-role {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    gap: 4px;
    padding: 16px 32px 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    margin-bottom: -1px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

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

/* ============ CONTENT ============ */
.content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============ ACCOUNT CARDS ============ */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.account-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.account-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: #cdd1e0;
}

.account-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.platform-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.platform-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.account-card-title {
    flex: 1;
    min-width: 0;
}

.account-card-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-card-title .platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

.account-card-body {
    padding: 16px 22px 20px;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.field-row:last-child {
    border-bottom: none;
}

.field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.field-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 65%;
    justify-content: flex-end;
}

.field-value .text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--color-text-muted);
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

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

.copy-btn svg {
    width: 14px;
    height: 14px;
}

.password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--color-text-muted);
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.password-toggle:hover {
    color: var(--color-primary);
}

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

.password-dots {
    letter-spacing: 2px;
}

/* ============ TOTP SECTION ============ */
.totp-section {
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.totp-code-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.totp-code {
    font-size: 22px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    color: var(--color-primary);
}

.totp-timer {
    position: relative;
    width: 32px;
    height: 32px;
}

.totp-timer svg {
    width: 32px;
    height: 32px;
    transform: rotate(-90deg);
}

.totp-timer .timer-bg {
    fill: none;
    stroke: #ddd6fe;
    stroke-width: 3;
}

.totp-timer .timer-progress {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.totp-timer .timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--color-primary);
}

/* ============ INSTRUCTION SECTION ============ */
.instruction-section {
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
}

.instruction-section .instruction-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.instruction-section .instruction-content {
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.instruction-content h1,
.instruction-content h2,
.instruction-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin: 8px 0 4px;
}

.instruction-content code {
    background: rgba(79, 70, 229, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.instruction-content a {
    color: var(--color-primary);
}

.instruction-content ul,
.instruction-content ol {
    padding-left: 20px;
}

/* ============ PLATFORM LINK ============ */
.platform-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.platform-link-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.platform-link-btn svg {
    width: 14px;
    height: 14px;
}

/* ============ MODAL ============ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 29, 46, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

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

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-bg);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

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

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

/* ============ ADMIN TABLES ============ */
.admin-section {
    margin-bottom: 36px;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.admin-section-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
}

.admin-table-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.admin-table th {
    padding: 12px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.admin-table td {
    padding: 12px 18px;
    font-size: 13px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--color-surface-hover);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-admin {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.badge-user {
    background: var(--color-success-light);
    color: var(--color-success);
}

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    background: var(--color-text);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

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

.toast.toast-error {
    background: var(--color-danger);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ OTP INPUT ============ */
.otp-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.otp-input-group input {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
    font-family: 'Courier New', monospace;
}

.otp-input-group input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.otp-message {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

.otp-message strong {
    color: var(--color-text);
}

/* ============ LOGIN STEP ANIMATION ============ */
.login-step {
    display: none;
}

.login-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

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

/* ============ ALLOCATION MODAL  ============ */
.allocation-list {
    max-height: 300px;
    overflow-y: auto;
}

.allocation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.allocation-item:hover {
    background: var(--color-bg);
}

.allocation-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.allocation-item label {
    cursor: pointer;
    flex: 1;
}

.allocation-item .alloc-email {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.allocation-item .alloc-name {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ============ ICON PICKER ============ */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.icon-option {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    background: var(--color-surface);
}

.icon-option:hover {
    border-color: var(--color-border);
    transform: scale(1.05);
}

.icon-option.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.icon-option img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ============ RESPONSIVE ============ */

/* Tablet */
@media (max-width: 900px) {
    .accounts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Header */
    .dashboard-header {
        padding: 0 12px;
        height: 56px;
        gap: 8px;
    }

    .dashboard-header .brand h2 {
        font-size: 14px;
    }

    .dashboard-header .brand-logo {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .dashboard-header .brand-logo svg {
        width: 16px;
        height: 16px;
    }

    .dashboard-header .brand {
        gap: 8px;
    }

    .header-actions {
        gap: 4px;
    }

    .header-user {
        padding: 4px 8px;
        margin-right: 4px;
    }

    .header-user .user-info {
        display: none;
    }

    .header-user .avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

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

    .btn-sm svg {
        width: 14px;
        height: 14px;
    }

    /* Hide button text on mobile, show only icons */
    #changePasswordBtn,
    #logoutBtn {
        gap: 0;
        padding: 8px;
    }

    #changePasswordBtn span,
    #logoutBtn span {
        display: none;
    }

    /* Tabs */
    .tabs {
        padding: 8px 12px 0;
        overflow-x: auto;
        gap: 2px;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Content */
    .content {
        padding: 16px 12px;
    }

    .accounts-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Account Cards */
    .account-card:hover {
        transform: none;
    }

    .account-card-header {
        padding: 16px 16px 12px;
        gap: 12px;
    }

    .platform-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .platform-icon img {
        width: 22px;
        height: 22px;
    }

    .account-card-title h3 {
        font-size: 14px;
    }

    .account-card-body {
        padding: 12px 16px 16px;
    }

    .field-row {
        padding: 7px 0;
        flex-wrap: wrap;
        gap: 4px;
    }

    .field-label {
        font-size: 11px;
    }

    .field-value {
        max-width: 100%;
        font-size: 12px;
        gap: 6px;
    }

    /* TOTP */
    .totp-section {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .totp-code {
        font-size: 18px;
        letter-spacing: 3px;
    }

    /* Instructions */
    .instruction-section {
        padding: 12px 14px;
    }

    /* Platform link */
    .platform-link-btn {
        font-size: 11px;
        padding: 7px 12px;
    }

    /* Modal */
    .modal-backdrop {
        padding: 8px;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .modal-header {
        padding: 18px 20px 12px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 16px 20px;
    }

    .modal-footer {
        padding: 12px 20px 20px;
    }

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

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    /* Icon picker */
    .icon-picker {
        grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
        gap: 6px;
        max-height: 160px;
    }

    .icon-option {
        width: 42px;
        height: 42px;
    }

    .icon-option img {
        width: 22px;
        height: 22px;
    }

    /* Admin Tables */
    .admin-section {
        margin-bottom: 24px;
    }

    .admin-section-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .admin-section-header h3 {
        font-size: 15px;
    }

    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .admin-table .actions {
        gap: 2px;
    }

    .admin-table .actions .btn {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* Login page */
    .login-card {
        max-width: 100%;
        border-radius: var(--radius-lg);
    }

    .login-header {
        padding: 28px 20px;
    }

    .login-header h1 {
        font-size: 19px;
    }

    .login-header p {
        font-size: 13px;
    }

    .login-body {
        padding: 24px 20px 28px;
    }

    /* OTP */
    .otp-input-group {
        gap: 6px;
    }

    .otp-input-group input {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }

    .otp-message {
        font-size: 13px;
    }

    /* Toast */
    .toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        max-width: 100%;
        font-size: 12px;
        padding: 12px 16px;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 16px;
    }

    .empty-state svg {
        width: 48px;
        height: 48px;
    }

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

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

/* Small phones */
@media (max-width: 380px) {
    .dashboard-header .brand h2 {
        font-size: 12px;
    }

    .otp-input-group input {
        width: 36px;
        height: 44px;
        font-size: 18px;
    }

    .accounts-grid {
        gap: 10px;
    }

    .totp-code {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .login-header {
        padding: 24px 16px;
    }

    .login-body {
        padding: 20px 16px 24px;
    }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}