/* Pushkar Site - Premium Construction Task Manager */
/* Crisp black & white with natural accents */

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

:root {
    /* Core palette - Crisp black & white */
    --bg-deep: #000000;
    --bg-primary: #0a0a0a;
    --bg-card: #141414;
    --bg-elevated: #1a1a1a;
    --bg-input: #222222;

    /* Text hierarchy */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;

    /* Natural accent colors */
    --accent: #ffffff;
    --accent-bright: #ffffff;
    --accent-dim: #888888;
    --accent-glow: rgba(255, 255, 255, 0.1);

    /* Agency color - Warm terracotta */
    --agency: #e07a5f;
    --agency-bg: rgba(224, 122, 95, 0.15);

    /* Location color - Ocean teal */
    --location: #48b5a0;
    --location-bg: rgba(72, 181, 160, 0.15);

    /* Deadline color - Amber */
    --deadline: #f4a261;
    --deadline-bg: rgba(244, 162, 97, 0.12);

    /* Status colors */
    --success: #6bcb77;
    --success-dim: #4ade80;
    --warning: #f4a261;
    --danger: #e07a5f;
    --danger-dim: #d65f4a;

    /* Surfaces */
    --border: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --glass: rgba(10, 10, 10, 0.9);

    /* Effects */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);

    /* System */
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Minimal background - crisp black */
.noise-overlay,
.gradient-orb,
.gradient-orb-1,
.gradient-orb-2 {
    display: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

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

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

/* Sync Indicator */
.sync-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
    opacity: 0;
    transition: opacity 0.3s;
}

.sync-indicator.synced {
    opacity: 1;
}

.sync-indicator.syncing {
    opacity: 1;
    background: var(--warning);
    animation: pulse 1s infinite;
}

.sync-indicator.error {
    opacity: 1;
    background: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* App Container */
.app {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.header-left {
    width: 44px;
}

.header-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: center;
}

.title-accent {
    color: var(--text-primary);
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-toggle:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}

.lang-toggle:active {
    transform: scale(0.95);
}

.lang-icon {
    width: 14px;
    height: 14px;
}

.header-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 12px;
    transition: all var(--transition-fast);
}

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

.header-btn:active {
    transform: scale(0.92);
}

.header-btn svg {
    width: 24px;
    height: 24px;
}

/* Task List */
.task-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-list::-webkit-scrollbar {
    width: 4px;
}

.task-list::-webkit-scrollbar-track {
    background: transparent;
}

.task-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Task Card */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.task-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--bg-elevated);
}

.task-card:active {
    transform: scale(0.99);
}

.task-card.done {
    opacity: 0.4;
}

.task-card.done .task-text {
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
}

.task-card.card-overdue {
    border-left: 3px solid var(--danger);
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.task-text {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    word-wrap: break-word;
    flex: 1;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* Inline Tags */
.tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.tag-agency {
    background: var(--agency-bg);
    color: var(--agency);
    border: 1px solid rgba(224, 122, 95, 0.25);
}

.tag-location {
    background: var(--location-bg);
    color: var(--location);
    border: 1px solid rgba(72, 181, 160, 0.25);
}

.tag-deadline {
    background: var(--deadline-bg);
    color: var(--deadline);
    border: 1px solid rgba(244, 162, 97, 0.25);
    font-weight: 600;
}

.tag-deadline.overdue {
    background: rgba(224, 122, 95, 0.15);
    color: var(--danger);
    border-color: rgba(224, 122, 95, 0.35);
}

.tag-attach {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.empty-state .hint {
    margin-top: 24px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

.empty-state .hint code {
    color: var(--text-primary);
    font-weight: 500;
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Chat Input Container */
.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 20px;
    padding-bottom: calc(16px + var(--safe-bottom));
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.attach-btn,
.send-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

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

.send-btn:hover {
    transform: scale(1.05);
    background: #e0e0e0;
}

.send-btn:active,
.attach-btn:active {
    transform: scale(0.92);
}

.attach-btn svg,
.send-btn svg {
    width: 20px;
    height: 20px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

#task-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 14px 20px;
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    transition: all var(--transition-fast);
}

#task-input::placeholder {
    color: var(--text-muted);
}

#task-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

/* Mention/Location Popup */
.mention-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    animation: popupSlide 0.2s ease;
}

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

.mention-popup.active {
    display: block;
}

.mention-popup-header {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.mention-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
}

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

.mention-item:hover,
.mention-item.selected {
    background: var(--bg-input);
}

.mention-item .avatar {
    width: 36px;
    height: 36px;
    background: var(--agency-bg);
    border: 1px solid rgba(224, 122, 95, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--agency);
}

.mention-item.location-item .avatar {
    background: var(--location-bg);
    border-color: rgba(72, 181, 160, 0.3);
    color: var(--location);
}

.mention-item .name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.mention-item.new-item .name {
    color: var(--text-secondary);
    font-style: italic;
}

.mention-item.new-item .avatar {
    background: transparent;
    border: 2px dashed var(--agency);
    color: var(--agency);
}

.mention-item.new-item.location-item .avatar {
    border-color: var(--location);
    color: var(--location);
}

/* Attach Menu */
.attach-menu {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    left: max(20px, calc(50% - 300px + 20px));
    right: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    animation: menuFade 0.2s ease;
}

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

.attach-menu.active {
    display: flex;
}

.attach-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.attach-option:hover {
    background: var(--bg-input);
}

.attach-option:active {
    transform: scale(0.98);
}

.attach-option svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* Attachment Preview */
.attachment-preview {
    display: none;
    padding: 12px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.attachment-preview.active {
    display: flex;
}

.attachment-item {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.attachment-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
}

.attachment-item .file-icon {
    width: 64px;
    height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.attachment-item .file-icon svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.attachment-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.attachment-remove:hover {
    transform: scale(1.1);
}

.attachment-remove svg {
    width: 12px;
    height: 12px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

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


/* Task Detail Modal Content */
.detail-text {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.detail-agencies,
.detail-locations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-deadline-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.deadline-date {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Edit Form */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.edit-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.edit-field textarea,
.edit-field input[type="date"],
.edit-field select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.edit-field textarea:focus,
.edit-field input:focus,
.edit-field select:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.edit-field textarea {
    resize: vertical;
    min-height: 80px;
}

.edit-field select {
    cursor: pointer;
}

.edit-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.edit-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.edit-tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
    padding: 0;
}

.edit-tag button:hover {
    opacity: 1;
}

.edit-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
}

.edit-input-wrapper {
    position: relative;
}

.edit-input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.edit-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.edit-input-wrapper input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

/* Edit mode popup */
.edit-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: var(--shadow);
}

.edit-popup.active {
    display: block;
}

.edit-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 14px;
}

.edit-popup-item:hover,
.edit-popup-item.selected {
    background: var(--bg-input);
}

.edit-popup-avatar {
    width: 28px;
    height: 28px;
    background: var(--agency-bg);
    border: 1px solid rgba(224, 122, 95, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--agency);
}

.edit-popup-item.new-item .edit-popup-avatar {
    background: transparent;
    border: 2px dashed var(--text-muted);
    color: var(--text-muted);
}

.edit-popup-item.new-item span:last-child {
    color: var(--text-secondary);
    font-style: italic;
}

/* Additional button styles */
.btn-edit {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    flex: 0 0 auto;
    width: 48px;
}

.btn-edit:hover {
    background: var(--bg-elevated);
}

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

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

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

.detail-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-attachment {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.detail-attachment img {
    max-width: 200px;
    max-height: 200px;
    display: block;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.detail-attachment img:hover {
    transform: scale(1.02);
}

.detail-attachment .file-preview {
    background: var(--bg-input);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.detail-attachment .file-preview:hover {
    background: var(--bg-elevated);
}

.detail-attachment .file-preview svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

/* Action Buttons */
.modal-actions {
    display: flex;
    gap: 10px;
    padding: 18px 24px;
    padding-bottom: calc(18px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-actions .btn {
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.modal-actions .btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Icon-only buttons */
.modal-actions .btn-edit,
.modal-actions .btn-delete,
.modal-actions .btn-share {
    flex: 0 0 auto;
    width: 50px;
    padding: 14px;
}

/* Main action buttons */
.modal-actions .btn-done,
.modal-actions .btn-pending {
    flex: 1;
}

.modal-actions .btn:active {
    transform: scale(0.97);
}

.modal-actions .btn svg {
    width: 18px;
    height: 18px;
}

.btn-done {
    background: var(--success);
    color: var(--bg-deep);
}

.btn-pending {
    background: var(--deadline);
    color: var(--bg-deep);
}

.btn-delete {
    background: var(--bg-input);
    color: var(--danger);
    border: 1px solid var(--border);
}

.btn-delete:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: var(--danger);
}

.btn-share {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-share:hover {
    background: var(--bg-elevated);
}

/* Settings Modal */
.settings-section {
    margin-bottom: 28px;
}

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

.settings-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.filter-options {
    display: flex;
    gap: 8px;
}

.filter-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.filter-btn.active {
    background: var(--text-primary);
    color: var(--bg-deep);
    border-color: transparent;
}

.agency-list,
.location-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    min-height: 44px;
}

.item-chip {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
}

.item-chip:hover {
    border-color: var(--text-muted);
}

.item-chip button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: color var(--transition-fast);
}

.item-chip button:hover {
    color: var(--danger);
}

.item-chip button svg {
    width: 14px;
    height: 14px;
}

.add-item-row {
    display: flex;
    gap: 10px;
}

.add-item-row input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    transition: all var(--transition-fast);
}

.add-item-row input::placeholder {
    color: var(--text-muted);
}

.add-item-row input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.add-item-btn {
    background: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    color: var(--bg-deep);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-item-btn:hover {
    transform: translateY(-1px);
    background: #e0e0e0;
}

.add-item-btn:active {
    transform: scale(0.97);
}

.action-btn {
    width: 100%;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    margin-bottom: 10px;
    text-align: left;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border);
}

.action-btn:active {
    transform: scale(0.99);
}

.action-btn:last-child {
    margin-bottom: 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 28px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

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

/* Desktop Adjustments */
@media (min-width: 640px) {
    .app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }

    .modal-content {
        margin: auto;
        border-radius: var(--radius);
        max-height: 80vh;
    }

    .task-card:hover {
        box-shadow: var(--shadow-lg);
    }
}

/* Prevent iOS zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input {
        font-size: 16px;
    }
}

/* Animation for task cards */
.task-card {
    animation: cardEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

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

.task-list .task-card:nth-child(1) { animation-delay: 0.05s; }
.task-list .task-card:nth-child(2) { animation-delay: 0.1s; }
.task-list .task-card:nth-child(3) { animation-delay: 0.15s; }
.task-list .task-card:nth-child(4) { animation-delay: 0.2s; }
.task-list .task-card:nth-child(5) { animation-delay: 0.25s; }

/* ========================================
   LOGIN SCREEN
   ======================================== */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.login-screen.active {
    display: flex;
}

.login-container {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-header {
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.phone-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.country-code {
    padding: 14px 12px 14px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
    border-right: 1px solid var(--border);
    background: var(--bg-card);
}

.phone-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}

.phone-input-group input:focus {
    outline: none;
}

.phone-input-group input::placeholder {
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    letter-spacing: normal;
}

.otp-input-group {
    margin-bottom: 16px;
}

.otp-input-group input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 20px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.3em;
    text-align: center;
}

.otp-input-group input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: var(--text-primary);
    color: var(--bg-deep);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.login-btn:hover {
    background: #e0e0e0;
}

.login-btn:active {
    transform: scale(0.98);
}

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

.link-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    margin-top: 16px;
    font-family: 'Outfit', sans-serif;
    transition: color var(--transition-fast);
}

.link-btn:hover {
    color: var(--text-primary);
}

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

.otp-sent-msg span {
    color: var(--text-primary);
    font-weight: 500;
}

.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(224, 122, 95, 0.15);
    border: 1px solid rgba(224, 122, 95, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 14px;
}

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

.hidden {
    display: none !important;
}

/* reCAPTCHA container */
#recaptcha-container {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

/* ========================================
   USER MANAGEMENT
   ======================================== */
.admin-only {
    display: none;
}

.admin-only.visible {
    display: block;
}

.add-user-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.add-user-form .phone-input-group {
    margin-bottom: 0;
}

.add-user-form select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
}

.add-user-form select:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.user-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-phone {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    text-transform: capitalize;
}

.user-role.admin {
    color: var(--danger);
}

.user-role.manager {
    color: var(--deadline);
}

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

.user-item-actions {
    display: flex;
    gap: 8px;
}

.user-item-actions select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

.user-item-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color var(--transition-fast);
}

.user-item-actions button:hover {
    color: var(--danger);
}

.user-item-actions button svg {
    width: 16px;
    height: 16px;
}

.user-info {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.user-phone {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-role {
    font-size: 12px;
    text-transform: capitalize;
    color: var(--text-muted);
}

.user-role-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}

.user-role-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.user-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

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

.user-item-you {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

.current-user {
    background: rgba(255, 255, 255, 0.03);
}

.empty-users {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

.admin-only {
    display: none;
}

.user-info-phone {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-info-role {
    font-size: 12px;
    text-transform: capitalize;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--danger) !important;
    border-color: rgba(224, 122, 95, 0.3) !important;
}

.logout-btn:hover {
    background: rgba(224, 122, 95, 0.1) !important;
}

/* Role-based visibility */
.viewer-hidden {
    display: none !important;
}
