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

:root {
    --bg-base: #090c10;
    --bg-surface: #10141e;
    --bg-card: rgba(22, 28, 41, 0.75);
    --bg-card-hover: rgba(30, 38, 56, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(59, 130, 246, 0.5);
    
    --primary: #1d72f2;
    --primary-hover: #438af7;
    --primary-glow: rgba(29, 114, 242, 0.35);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --info: #06b6d4;
    --info-glow: rgba(6, 182, 212, 0.2);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --font-outfit: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --font-inter: 'Inter', system-ui, -apple-system, sans-serif;

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 15px var(--primary-glow);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(29, 114, 242, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
    padding-bottom: 70px;
    touch-action: manipulation;
}

@media (min-width: 769px) {
    body {
        padding-bottom: 0;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-outfit);
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* App Shell Layout */
.app-container {
    display: grid;
    grid-template-rows: 70px 1fr;
    min-height: 100vh;
}

/* Header Styles */
header {
    background-color: rgba(16, 20, 30, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-outfit);
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-glow);
    font-size: 18px;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    background: var(--primary);
    box-shadow: var(--shadow-glow);
}

.iam-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-selector-wrapper {
    position: relative;
}

.role-select {
    appearance: none;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 30px 8px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
    max-width: 170px;
    text-overflow: ellipsis;
}

.role-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.role-selector-wrapper::after {
    content: "▼";
    font-size: 8px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.user-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.role-supervisor { background: rgba(217, 70, 239, 0.15); color: #e879f9; border: 1px solid rgba(217, 70, 239, 0.3); }
.role-sa { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.role-tech { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.role-parts { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.3); }
.role-cashier { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Main Content Area */
main {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

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

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

/* Dashboard View */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-focus);
    background-color: var(--bg-card-hover);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card.stat-open::before { background: var(--info); }
.stat-card.stat-progress::before { background: var(--warning); }
.stat-card.stat-inspection::before { background: var(--primary); }
.stat-card.stat-released::before { background: var(--success); }

.stat-title {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-outfit);
    margin-top: 8px;
}

.team-list-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    overflow-x: auto;
}

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

.section-title {
    font-size: 17px;
    font-weight: 600;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 450px;
}

.team-table th {
    text-align: left;
    padding: 12px 14px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
}

.team-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

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

.tech-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #272f44;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--primary);
    border: 2px solid var(--border-color);
}

.tech-name {
    font-weight: 500;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.status-inside {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.status-outside {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.status-inside .pulse-dot {
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Sidebar / Geofence Widget */
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Geofence Radar Simulator */
.radar-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.radar-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29, 114, 242, 0.15) 0%, transparent 70%);
    border: 1px solid rgba(29, 114, 242, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.radar-circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    animation: radarSpin 4s linear infinite;
}

.radar-ping {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 15px var(--success);
    z-index: 10;
    transition: var(--transition-smooth);
}

.radar-ping.outside {
    background-color: var(--danger);
    box-shadow: 0 0 15px var(--danger);
}

.radar-sweep {
    position: absolute;
    width: 50%;
    height: 50%;
    background: linear-gradient(45deg, rgba(29, 114, 242, 0.3) 0%, transparent 100%);
    transform-origin: bottom right;
    bottom: 50%;
    right: 50%;
    animation: radarSweep 3s linear infinite;
}

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

.sim-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.btn {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    font-size: 13.5px;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-glow);
}

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

.location-coordinates {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px;
    border-radius: 6px;
    width: 100%;
}

/* Kanban Board View */
.kanban-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.swipe-hint-banner {
    display: none; /* Desktop hidden */
}

.mobile-stage-tabs {
    display: none;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    align-items: start;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.kanban-column {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    min-width: 250px;
    transition: var(--transition-smooth);
}

.kanban-column.drag-over {
    border-color: var(--primary);
    background-color: rgba(29, 114, 242, 0.03);
}

.column-header {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.column-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-title {
    font-size: 14px;
    font-weight: 600;
}

.column-count {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.column-body {
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

/* Task Cards */
.task-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    user-select: none;
}

.task-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-focus);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    background-color: var(--bg-card-hover);
}

.task-card.dragging {
    opacity: 0.4;
    border: 1px dashed var(--primary);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.task-reg {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.task-priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.task-priority-high { background-color: var(--danger); }
.task-priority-medium { background-color: var(--warning); }
.task-priority-low { background-color: var(--success); }

.task-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.3;
}

.task-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.task-deadline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-deadline.overdue {
    color: var(--danger);
    font-weight: 600;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(9, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    padding: 15px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-main);
    transform: translateY(20px);
    transition: var(--transition-smooth);
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--bg-surface);
    z-index: 10;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-outfit);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: var(--transition-smooth);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: white;
}

.modal-body {
    padding: 20px;
}

/* Task Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition-smooth);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-glow);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--bg-surface);
}

/* Task Detail Panel Specifics */
.task-detail-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 20px;
}

.info-section {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

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

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

.info-label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

.info-value {
    font-size: 13.5px;
    font-weight: 500;
}

/* Interactive Checklist */
.checklist-container {
    margin-bottom: 18px;
}

.checklist-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.checklist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-smooth);
    min-height: 44px;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.checklist-item.checked {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.05);
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1.5px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    margin-top: 1px;
    flex-shrink: 0;
}

.checklist-item.checked .checklist-checkbox {
    background-color: var(--success);
    border-color: var(--success);
    color: white;
}

.checklist-item.checked .checklist-checkbox::after {
    content: "✓";
    font-size: 12px;
    font-weight: bold;
}

.checklist-text {
    font-size: 13px;
    line-height: 1.4;
}

.checklist-item.checked .checklist-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Media Gallery & Attachment Area */
.media-container {
    margin-bottom: 20px;
}

.media-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.media-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.media-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    background: rgba(0, 0, 0, 0.15);
}

.media-upload-area:hover {
    border-color: var(--primary);
    background: rgba(29, 114, 242, 0.05);
}

.media-upload-icon {
    font-size: 24px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.media-upload-text {
    font-size: 12.5px;
    color: var(--text-muted);
}

.media-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.media-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--border-color);
    background: #000;
}

.media-item img, .media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* History logs */
.history-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    max-height: 250px;
    overflow-y: auto;
}

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

.history-item {
    font-size: 12px;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
}

.history-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 10px;
    margin-top: 4px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 15px;
    left: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

@media (min-width: 769px) {
    .toast-container {
        bottom: 20px;
        left: auto;
        right: 20px;
    }
}

.toast {
    background-color: var(--bg-surface);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
}

.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: rgba(16, 20, 30, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 150;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 11px;
    background: transparent;
    border: none;
    width: 33.33%;
    height: 100%;
    cursor: pointer;
}

.mobile-nav-item.active {
    color: var(--primary);
}

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

/* RESPONSIVE OVERRIDES FOR MOBILE PORTRAIT PHONES */
@media (max-width: 768px) {
    body {
        overflow-x: auto; /* Allow zooming & horizontal panning */
    }

    header {
        height: 60px;
        padding: 0 12px;
    }
    
    .nav-tabs {
        display: none;
    }
    
    .mobile-bottom-nav {
        display: flex;
    }

    .iam-container {
        gap: 4px;
    }

    .role-select {
        font-size: 12px;
        padding: 6px 22px 6px 8px;
        max-width: 130px;
    }

    #cloudStatusBadge {
        display: none;
    }

    main {
        padding: 12px 10px;
    }

    /* Mobile Swipe Hint Banner */
    .swipe-hint-banner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 11px;
        color: var(--text-muted);
        padding: 8px 12px;
        background: rgba(29, 114, 242, 0.1);
        border: 1px dashed rgba(29, 114, 242, 0.3);
        border-radius: 8px;
        margin-bottom: 10px;
        width: 100%;
    }

    /* Mobile Stage Quick Tabs */
    .mobile-stage-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 8px;
        width: 100%;
        margin-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-stage-pill {
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 12px;
        white-space: nowrap;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mobile-stage-pill.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    /* Kanban Horizontal Touch Scrolling Left & Right */
    .kanban-board {
        display: flex;
        flex-direction: row;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        gap: 14px;
        height: auto;
        min-height: calc(100vh - 230px);
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .kanban-column {
        min-width: 86vw;
        max-width: 86vw;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        flex-shrink: 0;
    }

    /* Dashboard mobile adjustments */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        min-height: 95px;
        padding: 12px;
    }

    .stat-value {
        font-size: 24px;
    }

    /* Task Detail modal bottom sheet for mobile */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
    }

    .task-detail-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .media-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
