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

body {
    font-family: 'Barlow', sans-serif;
    background: #0d0d0d;
    color: #e0e0e0;
    min-height: 100vh;
}


h1, h2, h3, h4 {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
}

/* Prevent iOS zoom on input focus */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
textarea,
select {
    font-size: 16px;
}

/* Login Screen */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0d0d;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.login-screen.fade-out {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 320px;
    padding: 24px;
}

.login-logo {
    max-width: 300px;
    width: 100%;
    margin-bottom: 8px;
}

.login-box h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

/* Login Options */
.login-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.login-options .btn-wrapper {
    width: 100%;
}

.guest-link {
    background: none;
    border: none;
    color: #666;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
    margin-top: 8px;
    transition: color 0.2s;
}

.guest-link:hover {
    color: #f1aa1c;
}

/* Login Forms */
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.login-form.hidden {
    display: none;
}

.form-description {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    line-height: 1.5;
}

.password-display-group {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.password-display {
    flex: 1;
    padding: 14px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #f1aa1c;
    font-family: 'Barlow', monospace;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.password-display:focus {
    outline: none;
    border-color: #444;
}

.icon-btn-wrapper,
.copy-btn-wrapper {
    position: relative;
    padding: 2px;
    border-radius: 10px;
    background: #0d0d0d;
    flex-shrink: 0;
}

.icon-btn-wrapper::before,
.copy-btn-wrapper::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: conic-gradient(
        from var(--border-angle),
        #000000 0deg,
        #f461ff 54deg,
        #00ffff 108deg,
        #ffffff 162deg,
        #ffffff 216deg,
        #000000 288deg,
        #000000 360deg
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.icon-btn-wrapper:hover::before,
.copy-btn-wrapper:hover::before {
    opacity: 1;
    animation: border-angle-spin 4s linear infinite;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

.icon-btn-wrapper:hover .icon-btn {
    background: #fff;
    color: #0d0d0d;
    box-shadow: 0 0 0 2px #0d0d0d;
}

.copy-btn {
    padding: 12px 16px;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    color: #888;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.copy-btn-wrapper:hover .copy-btn {
    background: #fff;
    color: #0d0d0d;
    box-shadow: 0 0 0 2px #0d0d0d;
}

.password-input {
    width: 100%;
    padding: 14px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    text-align: center;
}

.password-input:focus {
    outline: none;
    border-color: #444;
}

.password-input::placeholder {
    color: #555;
}

.text-link {
    background: none;
    border: none;
    color: #666;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.text-link:hover {
    color: #f1aa1c;
}

.back-to-options {
    margin-top: 8px;
}

/* Button wrapper for gradient border effect */
@property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.btn-wrapper {
    position: relative;
    width: 100%;
    padding: 2px;
    border-radius: 10px;
    background: #0d0d0d;
}

.btn-wrapper::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: conic-gradient(
        from var(--border-angle),
        #000000 0deg,
        #f461ff 54deg,
        #00ffff 108deg,
        #ffffff 162deg,
        #ffffff 216deg,
        #000000 288deg,
        #000000 360deg
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-wrapper:hover::before {
    opacity: 1;
    animation: border-angle-spin 4s linear infinite;
}

@keyframes border-angle-spin {
    from {
        --border-angle: 0deg;
    }
    to {
        --border-angle: 360deg;
    }
}

.login-btn {
    position: relative;
    width: 100%;
    padding: 14px 16px;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    color: #888;
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.3s, color 0.2s;
    z-index: 1;
}

.login-btn.primary {
    background: #f1aa1c;
    color: #0d0d0d;
}

.btn-wrapper:hover .login-btn {
    background: #fff;
    color: #0d0d0d;
    box-shadow: 0 0 0 2px #0d0d0d;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-msg {
    color: #ff6b6b;
    font-size: 0.85rem;
    min-height: 20px;
    text-align: center;
}

/* Onboarding Modal */
.onboarding-modal {
    z-index: 250;
}

.onboarding-content {
    max-width: 480px;
}

.onboarding-intro {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    margin-bottom: 24px;
}

.user-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.user-input-row {
    display: flex;
    gap: 8px;
}

.user-name-input {
    flex: 1;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
}

.user-name-input:focus {
    outline: none;
    border-color: #444;
}

.user-name-input::placeholder {
    color: #555;
}

.remove-user-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #666;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-user-btn:hover {
    background: #2a1a1a;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.add-user-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px dashed #2a2a2a;
    border-radius: 6px;
    color: #666;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.add-user-btn:hover {
    border-color: #f1aa1c;
    color: #f1aa1c;
}

.onboarding-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #2a2a2a;
}

/* App */
.app {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app.visible {
    opacity: 1;
    pointer-events: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #1a1a1a;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.nav-link {
    background: none;
    border: none;
    color: #666;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: #f1aa1c;
}

.nav-icon {
    display: none;
    flex-shrink: 0;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: background 0.2s;
}

.sync-dot.syncing {
    background: #f0a500;
}

.sync-dot.synced {
    background: #4ade80;
}

.sync-dot.error {
    background: #ff6b6b;
}

.settings-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.settings-btn:hover {
    color: #f1aa1c;
}

.header-right {
    flex-shrink: 0;
}

.search-input {
    width: 220px;
    padding: 10px 14px;
    padding-right: 36px;
    background: #1a1a1a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: #444;
}

.search-input::placeholder {
    color: #666;
}

.sync-status {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.sync-status.syncing {
    color: #f0a500;
}

.sync-status.synced {
    color: #4ade80;
}

.sync-status.error {
    color: #ff6b6b;
}

/* Main Content - Two Column Layout */
.main-content {
    display: flex;
    flex: 1;
    gap: 0;
}

.grid-column {
    flex: 0 0 75%;
    max-width: 75%;
    border-right: 1px solid #1a1a1a;
}

.missing-column {
    flex: 0 0 25%;
    max-width: 25%;
    min-width: 200px;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 24px;
}

.card {
    background: #141414;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.15s ease;
    opacity: 1;
}

.card:hover {
    border-color: #3a3a3a;
    background: #1a1a1a;
    transform: translateY(-2px);
}

.card.complete {
    border-color: #2d4a2d;
}

.card.complete:hover {
    border-color: #3d5a3d;
}

.card.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.card.hidden {
    display: none;
}

.no-results {
    display: none;
    text-align: center;
    padding: 60px 24px;
    color: #666;
    font-size: 1rem;
}

.no-results.visible {
    display: block;
}

.card-img {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-img img.hidden {
    display: none;
}

.card-img .fallback {
    color: #444;
    font-size: 10px;
    display: none;
}

.card-img img.hidden + .fallback {
    display: block;
}

.card-name {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.card-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #1f1f1f;
}

.check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
}

.check input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #3a3a3a;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    order: 1;
}

.check input[type="checkbox"]:hover {
    border-color: #4ade80;
}

.check input[type="checkbox"]:checked {
    background: #4ade80;
    border-color: #4ade80;
}

.check input[type="checkbox"]:checked::after {
    content: "";
    display: block;
    width: 6px;
    height: 10px;
    border: solid #0d0d0d;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    margin: 1px auto;
}

.check input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.check span {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    order: 0;
}

/* Missing Panel */
.missing-panel {
    padding: 20px;
    height: calc(100vh - 110px); /* Fallback, JS overrides */
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    transition: height 0.1s ease-out;
}

.toggle-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.toggle-wrapper {
    position: relative;
    flex: 1;
    padding: 2px;
    border-radius: 10px;
    background: #0d0d0d;
}

.toggle-wrapper::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: conic-gradient(
        from var(--border-angle),
        #000000 0deg,
        #f461ff 54deg,
        #00ffff 108deg,
        #ffffff 162deg,
        #ffffff 216deg,
        #000000 288deg,
        #000000 360deg
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.toggle-wrapper:hover:not(:has(.toggle-btn.active))::before {
    opacity: 1;
    animation: border-angle-spin 4s linear infinite;
}

.toggle-btn {
    position: relative;
    width: 100%;
    padding: 10px 16px;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    color: #888;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1;
}

.toggle-wrapper:hover:not(:has(.toggle-btn.active)) .toggle-btn {
    background: #fff;
    color: #0d0d0d;
    box-shadow: 0 0 0 2px #0d0d0d;
}

.toggle-btn.active {
    background: #f1aa1c;
    color: #0d0d0d;
}

/* User Dropdown (for 3+ users) */
.user-dropdown-container {
    margin-bottom: 20px;
}

.user-dropdown {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    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='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.user-dropdown:focus {
    outline: none;
    border-color: #f1aa1c;
}

.user-dropdown option {
    background: #1a1a1a;
    color: #fff;
}

.missing-header {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1a1a1a;
}

.missing-header #missingCount {
    color: #f1aa1c;
}

.missing-header .missing-label {
    color: #666;
}

.missing-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #0d0d0d;
}

.missing-list::-webkit-scrollbar {
    width: 8px;
}

.missing-list::-webkit-scrollbar-track {
    background: #0d0d0d;
}

.missing-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 50%, #4a4a4a 100%);
    border-radius: 4px;
}

.missing-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f461ff 0%, #00ffff 50%, #f461ff 100%);
}

.missing-list li {
    padding: 8px 0;
    border-bottom: 1px solid #1a1a1a;
    font-size: 0.85rem;
    color: #999;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0;
    animation: fadeInItem 0.2s ease forwards;
}

.missing-list li:hover {
    color: #f1aa1c;
}

.missing-list li:last-child {
    border-bottom: none;
}

.missing-list.fade-out li {
    opacity: 0;
    transition: opacity 0.1s ease;
}

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid #1a1a1a;
    font-size: 0.75rem;
    color: #555;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s ease;
}

.modal-overlay.visible .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #141414;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #141414;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 50%, #4a4a4a 100%);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f461ff 0%, #00ffff 50%, #f461ff 100%);
}

/* Settings Modal */
.settings-modal {
    max-width: 560px;
}

.settings-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #1f1f1f;
}

.settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-section h3 {
    font-size: 0.95rem;
    color: #f1aa1c;
    margin-bottom: 8px;
}

.settings-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.settings-row:last-child {
    margin-bottom: 0;
}

.session-info {
    flex: 1;
    color: #888;
    font-size: 0.9rem;
}

.settings-input {
    flex: 1;
    padding: 10px 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
}

.settings-input:focus {
    outline: none;
    border-color: #444;
}

.settings-input::placeholder {
    color: #555;
}

.settings-input:read-only {
    color: #888;
}

.settings-btn-primary {
    padding: 10px 16px;
    background: #f1aa1c;
    border: none;
    border-radius: 6px;
    color: #0d0d0d;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-btn-secondary {
    padding: 10px 16px;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    color: #888;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

/* Settings button wrapper for gradient border effect */
.settings-btn-wrapper {
    position: relative;
    flex-shrink: 0;
    padding: 2px;
    border-radius: 10px;
    background: transparent;
}

.settings-btn-wrapper:hover {
    background: #0d0d0d;
}

.settings-btn-wrapper::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: conic-gradient(
        from var(--border-angle),
        #000000 0deg,
        #f461ff 54deg,
        #00ffff 108deg,
        #ffffff 162deg,
        #00ffff 216deg,
        #f461ff 270deg,
        #000000 324deg,
        #000000 360deg
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.settings-btn-wrapper:hover::before {
    opacity: 1;
    animation: border-angle-spin 4s linear infinite;
}

.settings-btn-wrapper:hover .settings-btn-secondary,
.settings-btn-wrapper:hover .settings-icon-btn {
    background: #fff;
    color: #0d0d0d;
    box-shadow: 0 0 0 2px #0d0d0d;
}

.settings-btn-wrapper:hover .settings-btn-primary {
    background: #fff;
    color: #0d0d0d;
    box-shadow: 0 0 0 2px #0d0d0d;
}

/* Icon buttons for settings (eye toggle, copy) */
.settings-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-icon-btn:hover {
    color: #fff;
}

.settings-icon-btn svg {
    width: 18px;
    height: 18px;
}

.settings-icon-btn svg.hidden {
    display: none;
}

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

/* Toggle Switch */
.toggle-label {
    position: relative;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #aaa;
    padding: 12px 0;
    line-height: 1;
}

.toggle-label > span:last-child {
    margin-left: 12px;
    line-height: 24px;
}

.toggle-label > input,
.toggle-label > input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    clip: rect(0, 0, 0, 0) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    pointer-events: none !important;
}

.toggle-switch {
    display: inline-block;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    position: relative;
    transition: all 0.2s;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #555;
    border-radius: 50%;
    transition: all 0.2s;
}

.toggle-label input:checked + .toggle-switch {
    background: #f1aa1c;
    border-color: #f1aa1c;
}

.toggle-label input:checked + .toggle-switch::after {
    left: 23px;
    background: #0d0d0d;
}

.settings-subsection {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #1f1f1f;
}

.settings-subsection.hidden {
    display: none;
}

/* Users List */
.users-list-container {
    margin-bottom: 16px;
}

.settings-user-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.settings-user-name {
    flex: 1;
    padding: 10px 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
}

.settings-user-name:focus {
    outline: none;
    border-color: #444;
}

.settings-user-delete {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #666;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-user-delete:hover:not(:disabled) {
    background: #2a1a1a;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.settings-user-delete:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.add-user-row {
    margin-top: 12px;
}

/* Danger Zone */
.danger-zone h3 {
    color: #ff6b6b !important;
}

.danger-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #1a1414;
    border: 1px solid #2a1a1a;
    border-radius: 8px;
}

.danger-item strong {
    font-size: 0.9rem;
    color: #ccc;
    display: block;
    margin-bottom: 4px;
}

.danger-item p {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.danger-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #ff6b6b;
    border-radius: 6px;
    color: #ff6b6b;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.danger-btn:hover {
    background: #ff6b6b;
    color: #0d0d0d;
}

.danger-btn-severe {
    background: #ff6b6b;
    color: #0d0d0d;
}

.danger-btn-severe:hover {
    background: #ff4444;
}

/* Patch Notes */
.patch-note {
    margin-bottom: 32px;
}

.patch-note:last-child {
    margin-bottom: 0;
}

.patch-note h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #f1aa1c;
    margin-bottom: 4px;
}

.patch-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 16px;
}

.patch-note h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #999;
    margin: 16px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.patch-note ul {
    list-style: none;
    padding: 0;
}

.patch-note li {
    font-size: 0.85rem;
    color: #888;
    padding: 6px 0;
    padding-left: 16px;
    position: relative;
}

.patch-note li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #555;
}

/* Help sections */
.help-section {
    margin-bottom: 24px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 0.95rem;
    color: #f1aa1c;
    margin-bottom: 8px;
}

.help-section p {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.6;
    margin-bottom: 8px;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section strong {
    color: #ccc;
}

/* Guest mode indicator */
.app.guest-mode header::after {
    content: "Guest Mode";
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    padding: 4px 12px;
    background: #2a2a2a;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .grid-column {
        flex: none;
        max-width: 100%;
        order: 0;
        border-right: none;
        border-bottom: 1px solid #1a1a1a;
    }
    
    .missing-column {
        flex: none;
        max-width: 100%;
        min-width: auto;
        order: 1;
    }
    
    .missing-panel {
        height: auto;
        max-height: none;
        position: relative;
    }
    
    .missing-list {
        overflow-y: visible;
    }
}

@media (max-width: 860px) {
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 50;
        background: #0d0d0d;
    }
    
    .header-left {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px 14px;
    }
    
    .header-left h1 {
        font-size: 1.4rem;
    }
    
    .header-right {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .grid {
        padding: 16px 24px;
    }
    
    .app.guest-mode header::after {
        position: static;
        transform: none;
        display: inline-block;
        margin-left: auto;
    }
}

@media (max-width: 550px) {
    .sync-status {
        display: none;
    }
    
    .danger-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .danger-btn {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .app-footer {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
    
    .modal {
        max-height: calc(100vh - 120px);
    }
    
    .login-box {
        width: 100%;
        padding: 16px;
    }
    
    .settings-row {
        flex-wrap: wrap;
    }
    
    .settings-input {
        width: 100%;
    }
}

@media (max-width: 500px) {
    header {
        padding: 16px;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
        gap: 10px;
    }
    
    .card-img {
        height: 55px;
    }
    
    .missing-panel {
        padding: 16px;
    }
    
    .card-checks {
        gap: 4px;
    }
}

@media (max-width: 450px) {
    .header-left h1 {
        font-size: 1.1rem;
    }
    
    .nav-icon {
        display: block;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-link + .nav-link {
        margin-left: 0;
    }
    
    .sync-indicator {
        order: 10;
        margin-left: auto;
    }
    
    .header-left {
        gap: 10px;
    }
}

/* Password Option Tabs */
.password-option-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.password-tab-wrapper {
    position: relative;
    flex: 1;
    padding: 2px;
    border-radius: 10px;
    background: #0d0d0d;
}

.password-tab-wrapper::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: conic-gradient(
        from var(--border-angle),
        #000000 0deg,
        #f461ff 54deg,
        #00ffff 108deg,
        #ffffff 162deg,
        #ffffff 216deg,
        #000000 288deg,
        #000000 360deg
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.password-tab-wrapper:hover:not(:has(.password-tab.active))::before {
    opacity: 1;
    animation: border-angle-spin 4s linear infinite;
}

.password-tab {
    width: 100%;
    padding: 10px 16px;
    background: #1a1a1a;
    border: none;
    border-radius: 6px;
    color: #888;
    font-family: 'Barlow', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    z-index: 1;
    position: relative;
}

.password-tab-wrapper:hover:not(:has(.password-tab.active)) .password-tab {
    background: #fff;
    color: #0d0d0d;
    box-shadow: 0 0 0 2px #0d0d0d;
}

.password-tab.active {
    background: #f1aa1c;
    color: #0d0d0d;
}

.password-section {
    width: 100%;
}

.password-section .settings-input {
    width: 100%;
}

.password-section.hidden {
    display: none;
}

.password-status {
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 20px;
}

.password-status.available {
    color: #4ade80;
}

.password-status.unavailable {
    color: #ff6b6b;
}

.password-status.checking {
    color: #f0a500;
}

/* Hidden utility */
.hidden {
    display: none !important;
}
