/* --- CSS VARIABLES & RESET --- */
:root {
    --brand-purple: rgb(124, 77, 255);
    --brand-dark-bg: #0a0b12;
    --brand-dark-accent: #11131c;
    --main-content-white: #ffffff;
    --text-on-dark: #f0f0f0;
    --text-on-white: #333333;
    --muted-text-on-white: #777777;
    --border-color: rgba(0,0,0,0.06);
    --aside-width: 260px;
    --header-height: 80px;
    --border-radius: 10px;
    --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: var(--brand-dark-bg); color: var(--text-on-white); overflow: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; background: none; font-size: 0.9rem; }

/* --- LAYOUT GRID --- */
.app-container {
    display: grid;
    grid-template-areas: "header header" "aside main";
    grid-template-columns: var(--aside-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    height: 100vh;
}

/* --- HEADER & ASIDE --- */
.app-header, .app-aside {
    background-color: var(--brand-dark-bg);
    background-image: linear-gradient(90deg, rgba(255,255,255,.01) 1px, transparent 1px), linear-gradient(rgba(255,255,255,.01) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-on-dark);
}

.app-header {
    grid-area: header; display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; border-bottom: 1px solid rgba(255,255,255,0.05); z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.mweb-logo { height: 35px; }
.mweb-title { font-size: 1.2rem; font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 20px; }
.user-name { font-size: 1.1rem; }
.user-avatar { width: 45px; height: 45px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); object-fit: cover; }
.settings-btn { font-size: 1.4rem; color: rgba(255,255,255,0.5); transition: var(--transition); }
.settings-btn:hover { color: var(--brand-purple); transform: rotate(45deg); }
.settings-btn.active { color: var(--brand-purple); transform: rotate(45deg); }

.app-aside { grid-area: aside; padding: 30px 20px; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.05); overflow-y: auto; }
.aside-nav { display: flex; flex-direction: column; gap: 8px; }

.nav-item {
    display: flex; align-items: center; gap: 15px; padding: 12px 18px;
    font-size: 1.1rem; color: #b0b3bf; border-radius: var(--border-radius); transition: var(--transition);
}
.nav-item:hover { color: var(--text-on-dark); background-color: var(--brand-dark-accent); }
.nav-item.active { background-color: var(--brand-purple); color: var(--text-on-dark); font-weight: 600; }
.nav-item i { font-size: 1.2rem; min-width: 24px; text-align: center; }

/* Submenu Styling */
.nav-submenu {
    display: flex; flex-direction: column; gap: 8px;
    padding-left: 55px; padding-top: 5px; padding-bottom: 10px;
    overflow: hidden; transition: max-height 0.3s ease;
}
.nav-submenu a { color: #8b8e98; font-size: 0.95rem; font-weight: 500; transition: var(--transition); display: block; padding: 6px 0; }
.nav-submenu a:hover { color: var(--text-on-dark); }
.nav-submenu a.active { color: var(--brand-purple); font-weight: 600; }
.nav-chevron { margin-left: auto; font-size: 0.8rem !important; transition: transform 0.3s ease; }
.nav-item.open .nav-chevron { transform: rotate(180deg); }

/* --- MAIN CONTENT --- */
.app-main {
    grid-area: main; background-color: var(--main-content-white);
    border-top-left-radius: 30px; margin-top: -1px; padding: 40px; overflow-y: auto;
}

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.header-titles { display: flex; flex-direction: column; gap: 5px; }
.page-title { font-size: 2.2rem; font-weight: 700; color: var(--brand-dark-bg); margin-bottom: 0; }
.breadcrumbs { font-size: 0.9rem; color: var(--muted-text-on-white); font-weight: 500; }
.breadcrumbs a { color: var(--brand-purple); }
.breadcrumbs a:hover { text-decoration: underline; }

/* --- FILTERS BAR --- */
.filters-bar {
    display: flex; justify-content: space-between; align-items: center; background: #fafafa; padding: 15px 20px;
    border-radius: var(--border-radius); border: 1px solid var(--border-color); margin-bottom: 30px;
}
.filter-group { display: flex; align-items: center; gap: 15px; }
.filter-label { font-size: 0.9rem; font-weight: 600; color: var(--muted-text-on-white); }
.filter-select {
    padding: 8px 16px; border-radius: 6px; border: 1px solid #dcdfe4; background: #fff;
    font-family: inherit; font-size: 0.95rem; color: var(--text-on-white); cursor: pointer; outline: none;
}
.filter-select:focus { border-color: var(--brand-purple); }

/* --- LIST/TABLE GLOBAL STYLES --- */
.list-container, .website-list-container {
    background: #fff; 
    border-radius: var(--border-radius); 
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 25px rgba(0,0,0,0.02); 
    overflow: visible; /* <-- CHANGED FROM HIDDEN */
}

.list-grid { display: grid; align-items: center; gap: 15px; padding: 15px 25px; }
.list-header { 
    background-color: #fafafa; 
    font-weight: 600; 
    color: var(--muted-text-on-white); 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    border-bottom: 1px solid var(--border-color); 
    border-top-left-radius: var(--border-radius); /* <-- ADD THIS */
    border-top-right-radius: var(--border-radius); /* <-- ADD THIS */
}
.row-wrapper { border-bottom: 1px solid var(--border-color); }
.row-wrapper:last-child { border-bottom: none; }
.list-row { transition: var(--transition); }
.list-row:hover { background-color: #fcfcfc; }

/* Page Specific Grid Columns */
.website-list-container .list-grid, #website-rows-container .list-grid { grid-template-columns: 2fr 1.2fr 1fr 1.2fr 1.2fr 1.2fr; }
.list-container:has(#campaigns-rows-container) .list-grid { grid-template-columns: 1.5fr 2fr 1fr 1fr 1fr 1.2fr; }
.list-container:has(#projects-rows-container) .list-grid { grid-template-columns: 2fr 1.2fr 1fr 1fr 1.5fr 1fr; }
.list-container:has(#invoices-rows-container) .list-grid { grid-template-columns: 2fr 1fr 1.2fr 1.2fr 1fr 1fr; }
.list-container:has(#tasks-rows-container) .list-grid { grid-template-columns: 1.5fr 2fr 1fr 1fr 1.2fr 1fr 1fr; align-items: center; }

/* --- COLUMN ELEMENTS --- */
.col-details { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.col-tasks { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.col-dates { display: flex; flex-direction: column; font-size: 0.9rem; color: var(--text-on-white); gap: 3px; }
.col-dates span.muted { color: var(--muted-text-on-white); font-size: 0.8rem; font-weight: 600;}
.col-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center;}
.col-stats { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* Text Elements */
.web-title, .camp-title, .project-title { font-weight: 600; font-size: 1.1rem; color: var(--brand-dark-bg); }
.task-title { font-weight: 600; font-size: 1.05rem; color: var(--brand-dark-bg); }
.website-tag { font-weight: 600; font-size: 0.9rem; color: var(--brand-purple); }
.col-term { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 500;}
.col-term i { color: var(--muted-text-on-white); }
.project-desc, .invoice-desc { font-size: 0.85rem; color: var(--muted-text-on-white); line-height: 1.3; }
.task-ratio { font-weight: 600; font-size: 1.1rem; }
.task-pending { color: var(--brand-purple); }

/* Invoices & Costs */
.val-cost, .invoice-sum { font-weight: 600; font-size: 1.1rem; color: var(--brand-dark-bg); display: flex; flex-direction: column; gap: 3px;}
.val-cost .muted { font-weight: 500; font-size: 0.8rem; }
.cost-paid { color: #2e7d32; }
.cost-unpaid { color: #ef6c00; }
.date-value { font-size: 1rem; color: var(--text-on-white); font-weight: 500; }
.date-overdue { color: #d32f2f; font-weight: 600; }
.pdf-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.1rem; color: var(--brand-dark-bg); transition: var(--transition); }
.pdf-link i { color: #f40f02; font-size: 1.3rem; }
.pdf-link:hover { color: var(--brand-purple); text-decoration: underline; }

/* Social Icons & Banners */
.social-icons { display: flex; gap: 8px; color: var(--muted-text-on-white); font-size: 1.1rem; }
.social-icons .fa-facebook { color: #1877F2; }
.social-icons .fa-instagram { color: #E4405F; }
.social-icons .fa-linkedin { color: #0A66C2; }
.social-icons .fa-google { color: #DB4437; }
.banners-container { display: flex; gap: 6px; flex-wrap: wrap; }
.banner-thumb { width: 45px; height: 45px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; transition: var(--transition); }
.banner-thumb:hover { border-color: var(--brand-purple); transform: scale(1.1); }

/* =========================================
   STATUS BADGES & PRIORITIES
========================================= */
.badge { 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 600; 
    display: inline-block; 
    text-align: center; 
}

/* Status Colors */
.stat-pending { background-color: #f1f3f5; color: #495057; border: 1px solid #ced4da; }
.status-on, .status-safe { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.status-off, .status-danger { background-color: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.status-warning { background-color: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }

/* Priority Colors */
.priority-High { color: #c62828; background: #ffebee; padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 0.85rem; }
.priority-Medium { color: #e65100; background: #fff3e0; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85rem; }
.priority-Low { color: #2e7d32; background: #e8f5e9; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85rem; }
.priority-Finished { color: #9e9e9e; text-decoration: line-through; }
.priority-Canceled { color: #9e9e9e; text-decoration: line-through; }
.priority-Urgent { color: #fff; background: #b71c1c; padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; }

/* Types */
.type-ecommerce, .type-video, .type-blue { background: #e3f2fd; color: #1976d2; }
.type-blog, .type-graphic, .type-purple { background: #f3e5f5; color: #7b1fa2; }
.type-corporate, .type-uiux { background: #e8f5e9; color: #388e3c; }
.type-orange { background: #fff3e0; color: #ef6c00; }

/* Status */
.status-danger { color: #d32f2f; font-weight: 600; }
.status-safe { color: #333; }
.status-on, .status-completed, .status-paid, .stat-done { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.status-off, .prio-high { background: #ffebee; color: #c62828; }
.status-waiting, .status-working, .status-unpaid, .prio-medium { background: #fff3e0; color: #ef6c00; border: 1px solid #ffe0b2; }
.status-review, .stat-progress { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.stat-pending { background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; }
.prio-low { background: #e8f5e9; color: #2e7d32; }

/* --- BUTTONS --- */
.btn-text { color: var(--brand-purple); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; padding: 0; }
.btn-text:hover { color: #6529e7; text-decoration: underline; }

.btn-outline { border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 6px; transition: var(--transition); font-weight: 500; font-size: 0.85rem; background: #fff; color: var(--text-on-white);}
.btn-outline:hover { border-color: var(--brand-purple); color: var(--brand-purple); }

.btn-solid { background-color: var(--brand-purple); color: #fff; padding: 10px 20px; border-radius: 50px; font-weight: 600; transition: var(--transition); display: inline-flex; align-items: center; gap: 8px; }
.btn-solid:hover { background-color: #6529e7; }

.btn-toggle { border: 1px solid var(--border-color); padding: 8px 14px; border-radius: 6px; background: #fff; color: var(--text-on-white); font-weight: 600; font-size: 0.85rem; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; width: 100%; justify-content: center; }
.btn-toggle:hover { border-color: var(--brand-purple); color: var(--brand-purple); background: #fafafa; }

.btn-pay { background-color: var(--brand-dark-bg); color: #fff; border: 1px solid var(--brand-dark-bg); }
.btn-pay:hover { background-color: var(--brand-purple); border-color: var(--brand-purple); color: #fff; }

.btn-file-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background-color: #f0f2f5; border: 1px solid #dcdfe4; border-radius: 6px; color: var(--brand-dark-bg); font-weight: 600; font-size: 0.85rem; transition: var(--transition); }
.btn-file-link:hover { background-color: #e4e6eb; border-color: #caced4; }
.btn-file-link.disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }

/* --- DROPDOWNS --- */
.action-dropdown { position: relative; display: inline-block; }
.action-menu-btn { border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 20px; font-weight: 600; font-size: 0.8rem; color: var(--text-on-white); display: flex; align-items: center; gap: 6px; transition: var(--transition); background: #fff;}
.action-menu-btn:hover { border-color: var(--brand-purple); color: var(--brand-purple); }
.action-menu-content { visibility: hidden; opacity: 0; position: absolute; right: 0; top: 100%; padding-top: 10px; transition: opacity 0.2s, visibility 0.2s; z-index: 100; }
.action-menu-inner { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-radius: 8px; border: 1px solid var(--border-color); overflow: hidden; min-width: 160px; }
.action-dropdown:hover .action-menu-content { visibility: visible; opacity: 1; }
.action-menu-item { padding: 10px 15px; font-size: 0.85rem; font-weight: 500; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: var(--transition); border-bottom: 1px solid #f5f5f5; color: var(--text-on-white); }
.action-menu-item:last-child { border-bottom: none; }
.action-menu-item:hover { background-color: #fafafa; color: var(--brand-purple); padding-left: 18px; }

/* --- EXPANDED DETAILS & COMMENTS --- */
.task-expanded, .comments-expanded { display: none; padding: 25px 45px; background-color: #fbfbfb; border-top: 1px dashed var(--border-color); box-shadow: inset 0 5px 10px rgba(0,0,0,0.01); }
.expanded-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.desc-box h4, .attach-box h4 { font-size: 0.9rem; color: var(--brand-dark-bg); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;}
.desc-box h4 i, .attach-box h4 i { color: var(--brand-purple); }

.rich-text-content { background: #fff; padding: 20px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 0.95rem; line-height: 1.6; color: var(--text-on-white); }
.rich-text-content b { font-weight: 700; color: var(--brand-dark-bg); }
.rich-text-content i { font-style: italic; }
.rich-text-content ul { padding-left: 20px; margin-top: 10px; }

.attachments-list { display: flex; flex-direction: column; gap: 10px; }
.attachment-pill { display: flex; align-items: center; gap: 12px; padding: 12px 15px; background: #fff; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.9rem; font-weight: 600; transition: var(--transition); color: var(--text-on-white); text-decoration: none; }
.attachment-pill:hover { border-color: var(--brand-purple); color: var(--brand-purple); box-shadow: 0 4px 10px rgba(124, 77, 255, 0.08); transform: translateY(-2px); }
.attachment-pill i { font-size: 1.2rem; }
.doc-icon { color: #1976d2; }
.img-icon { color: #f57c00; }
.download-icon { color: var(--muted-text-on-white); font-size: 1rem !important; transition: var(--transition); }
.attachment-pill:hover .download-icon { color: var(--brand-purple); }

.comment-item { background: #fff; padding: 15px; border-radius: 8px; border: 1px solid var(--border-color); margin-bottom: 12px; }
.comment-meta { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.85rem; color: var(--muted-text-on-white); }
.comment-author { font-weight: 600; color: var(--brand-dark-bg); }
.comment-text { font-size: 0.95rem; }
.comment-add-area { display: flex; gap: 10px; margin-top: 15px; }
.comment-input { flex: 1; padding: 10px 15px; border-radius: 6px; border: 1px solid var(--border-color); outline: none; font-family: inherit; }

/* --- DASHBOARD SPECIFIC --- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.dash-card { background: #fff; border-radius: var(--border-radius); padding: 30px; box-shadow: 0 5px 25px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.02); display: flex; flex-direction: column; justify-content: space-between; transition: var(--transition); }
.dash-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.07); }
.card-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.card-icon { font-size: 1.6rem; color: var(--brand-purple); }
.card-title { font-size: 1.3rem; font-weight: 600; }
.card-stats { display: flex; flex-direction: column; gap: 10px; margin-bottom: 25px; }
.stat-line { display: flex; justify-content: space-between; font-size: 1.1rem; }
.stat-label { color: var(--muted-text-on-white); }
.stat-value { font-weight: 600; font-size: 1.2rem; }
.priority { color: #f44336; }
.paid { color: #4caf50; }
.unpaid { color: #ff9800; }
.card-btn { background-color: var(--brand-purple); color: #fff; padding: 14px 28px; border-radius: 50px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); margin-top: auto; }
.card-btn:hover { background-color: #6529e7; }

/* --- SETTINGS/PROFILE SPECIFIC --- */
.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.form-card { background: #fff; border-radius: var(--border-radius); border: 1px solid var(--border-color); padding: 30px; box-shadow: 0 5px 25px rgba(0,0,0,0.02); }
.form-card.full-width { grid-column: 1 / -1; }
.form-card-title { font-size: 1.2rem; font-weight: 600; color: var(--brand-dark-bg); margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; }
.form-card-title i { color: var(--brand-purple); }
.avatar-upload-area { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid #fafafa; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.avatar-actions { display: flex; flex-direction: column; gap: 8px; }
.avatar-hint { font-size: 0.8rem; color: var(--muted-text-on-white); }

/* --- FORMS & MODALS --- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { 
    background: #fff; 
    width: 600px; 
    max-width: 90%; 
    max-height: 90vh; /* Never taller than 90% of the screen */
    display: flex; 
    flex-direction: column; /* Allows body to scroll while header/footer stay fixed */
    border-radius: 12px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); 
}
.modal-content.img-modal { max-width: 90%; max-height: 90%; width: auto; background: transparent; box-shadow: none;}
.modal-header { padding: 20px 25px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: #fff; }
.modal-header h2 { font-size: 1.3rem; color: var(--brand-dark-bg); margin: 0; }
.close-modal { font-size: 1.5rem; color: var(--muted-text-on-white); cursor: pointer; }
.close-modal:hover { color: #d32f2f; }
.close-img-modal { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 2rem; cursor: pointer; }

.modal-body { 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    background: #fff; 
    overflow-y: auto; /* Creates the internal scrollbar */
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--muted-text-on-white); text-transform: uppercase; letter-spacing: 0.5px; }
.form-control { width: 100%; padding: 10px 15px; border-radius: 6px; border: 1px solid #dcdfe4; font-family: inherit; font-size: 0.95rem; outline: none; background: #fafafa; color: var(--text-on-white); transition: var(--transition); }
.form-control:focus { border-color: var(--brand-purple); background: #fff; box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.rich-text-editor { border: 1px solid #dcdfe4; border-radius: 6px; overflow: hidden; }
.editor-toolbar { background: #fafafa; padding: 8px 10px; border-bottom: 1px solid #dcdfe4; display: flex; gap: 5px; }
.toolbar-btn { padding: 6px 10px; border-radius: 4px; border: none; background: transparent; cursor: pointer; color: var(--text-on-white); font-size: 0.9rem; }
.toolbar-btn:hover { background: #e4e6eb; color: var(--brand-purple); }
.editor-textarea { width: 100%; min-height: 120px; padding: 15px; border: none; resize: vertical; outline: none; font-family: inherit; }

.file-upload-area { border: 2px dashed #dcdfe4; padding: 20px; text-align: center; border-radius: 6px; color: var(--muted-text-on-white); cursor: pointer; transition: var(--transition); }
.file-upload-area:hover { border-color: var(--brand-purple); color: var(--brand-purple); background: rgba(124, 77, 255, 0.02); }

.modal-footer { padding: 15px 25px; border-top: 1px solid var(--border-color); background: #fafafa; display: flex; justify-content: flex-end; gap: 10px; }
.btn-cancel { padding: 10px 20px; font-weight: 600; color: var(--muted-text-on-white); }
.btn-cancel:hover { color: var(--brand-dark-bg); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 20px; }

/* =========================================
   LOGIN & AUTH PAGES
========================================= */
body.login-page {
    background-color: var(--brand-dark-bg);
    background-image: 
        linear-gradient(90deg, rgba(255,255,255,.01) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.01) 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.login-container { width: 100%; max-width: 420px; padding: 20px; z-index: 10; }

.login-logo-area { text-align: center;}
.login-logo-area img, .login-logo-area svg { width: auto; height: 65px; margin-bottom: 15px; }
.login-logo-area h1 { color: #fff; font-size: 1.8rem; font-weight: 700; letter-spacing: 0.5px; }

.login-card { background: #fff; border-radius: var(--border-radius); padding: 40px; box-shadow: 0 15px 50px rgba(0,0,0,0.3); }
.login-card h2 { color: var(--brand-dark-bg); font-size: 1.3rem; margin-bottom: 15px; text-align: center; font-weight: 600; }
.login-card p { color: var(--muted-text-on-white); font-size: 0.9rem; text-align: center; margin-bottom: 25px; line-height: 1.5; }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; font-size: 0.85rem; margin-top: 5px; }
.form-options.center { justify-content: center; margin-top: 25px; }

.forgot-link { color: var(--brand-purple); font-weight: 600; transition: var(--transition); }
.forgot-link:hover { color: #6529e7; text-decoration: underline; }

.back-link { color: var(--text-on-white); font-weight: 600; transition: var(--transition); display: flex; align-items: center; gap: 8px; justify-content: center; }
.back-link:hover { color: var(--brand-purple); }

.btn-login { width: 100%; justify-content: center; font-size: 1rem; padding: 14px; margin-top: 10px; }

/* Alert Styling for Auth Pages */
.alert, .error-alert {
    padding: 12px 15px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 10px;
}
.alert-error, .error-alert { background-color: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-success { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }



/* --- DASHBOARD 2x2 LAYOUT --- */
.dashboard-2x2 {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr;
    height: calc(100vh - 220px); 
    min-height: 500px;
}
.card-buttons { display: flex; gap: 15px; margin-top: auto; }
.card-buttons .card-btn { flex: 1; margin-top: 0; }
.card-btn-outline { background-color: transparent; color: var(--brand-purple); border: 2px solid var(--brand-purple); }
.card-btn-outline:hover { background-color: rgba(124, 77, 255, 0.05); }



/* =========================================
   TASKS PAGE LAYOUT & COLORS
========================================= */
.task-list-grid { 
    grid-template-columns: 1.5fr 2fr 1fr 1fr 1.2fr 1fr 1fr; 
    align-items: center; 
}
.file-upload-wrapper { position: relative; overflow: hidden; display: inline-block; width: 100%; }
.file-upload-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; height: 100%; }

/* Fixes the action menu so it sits on top of everything */
.action-menu-content { z-index: 9999 !important; position: absolute; }
.status-link { display: block; text-decoration: none; color: inherit; }

/* Forces the badge and timestamp to stack neatly */
.status-stack { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.status-time { font-size: 0.75rem; color: #888; white-space: nowrap; }

/* Priority Colors (Capitalized to match output) */
.priority-Urgent { color: #fff; background: #b71c1c; padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; }
.priority-High { color: #c62828; background: #ffebee; padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 0.85rem; }
.priority-Medium { color: #e65100; background: #fff3e0; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85rem; }
.priority-Low { color: #2e7d32; background: #e8f5e9; padding: 4px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85rem; }

/* Total Price Row */
.total-price-row { display: flex; justify-content: flex-end; padding: 20px; background: #f8f9fa; border-top: 2px solid #e9ecef; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; font-size: 1.1rem; }

/* =========================================
   MODAL TABS UI
========================================= */
.modal-tabs { display: flex; border-bottom: 1px solid var(--border-color); background: #fafafa; padding: 0 25px; flex-shrink: 0; }
.tab-btn { padding: 15px 20px; font-weight: 600; font-size: 0.9rem; color: var(--muted-text-on-white); border-bottom: 3px solid transparent; transition: var(--transition); }
.tab-btn:hover { color: var(--brand-purple); background: #f0f0f0; }
.tab-btn.active { color: var(--brand-purple); border-bottom-color: var(--brand-purple); background: #fff; }

.tab-content { display: none; padding: 25px; overflow-y: auto; }
.tab-content.active { display: flex; flex-direction: column; gap: 15px; }

/* Timer UI */
.timer-controls { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 20px; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 15px; }
.timer-stats { display: flex; flex-direction: column; gap: 5px; }
.timer-stats strong { font-size: 1.2rem; color: var(--brand-dark-bg); }
.btn-start-timer { background: #2e7d32; color: #fff; padding: 10px 20px; border-radius: 6px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-start-timer:hover { background: #1b5e20; }
.btn-stop-timer { background: #c62828; color: #fff; padding: 10px 20px; border-radius: 6px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); animation: pulse 2s infinite; }
.btn-stop-timer:hover { background: #b71c1c; animation: none; }

/* Time History Table */
.time-log-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.85rem; }
.time-log-table th { background: #f5f5f5; padding: 10px; text-align: left; color: var(--muted-text-on-white); border-bottom: 2px solid var(--border-color); }
.time-log-table td { padding: 10px; border-bottom: 1px solid var(--border-color); color: var(--text-on-white); }
.time-log-table tr:last-child td { border-bottom: none; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(198, 40, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0); }
}





/* --- FOOTER --- */
.app-footer {
    text-align: center;
    padding: 15px 40px;
    color: var(--muted-text-on-white);
    font-size: 0.85rem;
}



/* =========================================
   HYBRID THEME: DARK HEX NAV & LIGHT MAIN
========================================= */
:root {
    --brand-purple: #4f46e5;
    --brand-purple-hover: #6366f1;
    --accent-gradient: linear-gradient(to right, #4f46e5, #a855f7);
}

/* 1. Apply Dark Hexagon Theme ONLY to Header & Aside */
.app-header, .app-aside {
    background-color: #020408 !important;
    background-image: 
        radial-gradient(circle at 50% 40%, rgba(6, 182, 212, 0.15) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%2306b6d4' stroke-width='1.5' stroke-opacity='0.15'/%3E%3C/svg%3E") !important;
    background-size: auto, 56px 100px !important; 
    border-color: rgba(30, 41, 59, 0.8) !important;
}

/* Force text colors in the dark areas to be light */
.app-header .mweb-title, .app-header .user-name {
    color: #ffffff !important;
}

.app-header .settings-btn {
    color: #94a3b8 !important;
}

.app-header .settings-btn:hover {
    color: #ffffff !important;
}

.app-aside .nav-item { 
    color: #94a3b8 !important; 
}

.app-aside .nav-item:hover, .app-aside .nav-item.active { 
    color: #ffffff !important; 
    background: rgba(168, 85, 247, 0.15) !important; 
    border-right: 3px solid #a855f7; /* Add a nice purple accent line on the active tab */
}

/* Submenu backgrounds to match dark aside */
.nav-submenu {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* 2. Keep the Awesome Gradient Accent Buttons Everywhere */
.btn-solid {
    background: var(--accent-gradient) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.25) !important;
    transition: all 0.3s ease;
}

.btn-solid:hover {
    box-shadow: 0 12px 20px rgba(168, 85, 247, 0.4) !important;
    transform: translateY(-2px);
}

/* Keep the purple gradient on icons when appropriate */
.stat-icon.purple i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}



/* =========================================
   MOBILE RESPONSIVENESS (App Mode)
========================================= */

/* Hide hamburger by default on desktop */
.mobile-menu-btn {
    display: none!important;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 15px;
    transition: color 0.2s;
}

.mobile-menu-btn:hover {
    color: var(--brand-purple);
}

/* Overlay to darken background when mobile menu is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* Desktop-only: hide the sidebar flags by default */
.mobile-sidebar-flags { 
    display: none !important; 
}

@media (max-width: 950px) {
    /* Header & Layout Adjustments */
    .mobile-menu-btn { 
        display: block !important; 
        font-size: 1.8rem !important; 
        margin-right: 0 !important;
        padding: 5px !important;
    }
    .mweb-title { display: none; } 
    
    /* Force main container to fit screen and kill desktop margin */
/* Nuke the desktop Grid/Flexbox layout so it stops reserving an empty column */
    .app-container {
        display: block !important; 
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    /* Force main container to fit screen and kill desktop margins/padding */
    .app-main { 
        display: block !important;
        margin-left: 0 !important; 
        padding-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 20px 15px !important; 
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        border-top-left-radius: 0!important;
    }
    
    .header-right { gap: 8px !important; }
    
    /* HIDE AVATAR, USERNAME, AND HEADER FLAGS ON MOBILE */
    .user-avatar { display: none !important; }
    .user-name { display: none !important; }
    .header-right .lang-switcher { display: none !important; }

    .settings-btn {
        padding: 5px !important;
        font-size: 1.1rem !important;
        margin-left: 0 !important;
    }

    /* Slide-out Sidebar */
    .app-aside {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        z-index: 100;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 80px; /* Space for the header */
        overflow-y: auto;  /* Allows scrolling if menu gets too tall */
    }
    
    .app-aside.open {
        left: 0;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    /* SHOW SIDEBAR FLAGS ON MOBILE */
    .mobile-sidebar-flags { 
        display: flex !important; 
    }

    /* Transform Data Tables into Stacked Cards */
    .list-header { display: none !important; } 
    
    .list-grid.list-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 20px;
        align-items: flex-start !important;
    }

    .col-actions {
        width: 100%;
        justify-content: flex-start !important;
        flex-wrap: wrap;
        margin-top: 10px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }
    
    /* Modals & Forms */
    .modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
    }
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    .modal-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* Stats & Profile Grids */
    .stats-top-grid, .profile-grid-2x2, .dash-grid-modern {
        grid-template-columns: 1fr !important;
    }
    
    /* Invoice Specific Overrides */
    .val-cost { font-size: 1.5rem !important; margin: 10px 0; }
    .col-dates { flex-direction: row; flex-wrap: wrap; gap: 10px; }
}


.app-header {
        padding: 15px 20px !important; 
        min-height: 70px !important; /* Forces a nice, tap-friendly height */
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* 2. Space out the Hamburger and Logo */
    .header-left {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important; 
    }

    /* 3. Make the Hamburger Menu bigger */
    .mobile-menu-btn { 
        display: block; 
        font-size: 1.8rem !important; 
        margin-right: 0 !important;
        padding: 5px !important;
    }

    /* 4. Ensure the Logo isn't shrinking awkwardly */
    .mweb-logo {
        max-height: 32px !important; 
        width: auto !important;
    }

    /* 5. Make the right-side icons larger for fingers */
    .header-right { 
        gap: 12px !important; 
    }
    
    .settings-btn {
        padding: 8px !important; /* Bigger touch target */
        font-size: 1.3rem !important; /* Visually larger icons */
        margin-left: 0 !important;
    }


