/* portal.css - replacement (REPLACE FULL FILE) */

/* --- global --- */
:root{
  --bg:#071c1a;
  --nav:#072223;
  --glass-bg: rgba(10,30,40,0.55);
  --glass-blue: rgba(8,45,64,0.62);
  --accent:#0ea5a1;
  --btn:#1f6fa8;
  --danger:#cc3366;
  --tile-padding:16px;
  --tile-height:180px;
}

/* Reset */
*{box-sizing:border-box;margin:0;padding:0;font-family:Inter, system-ui, Arial, sans-serif;color:#e7f6f9}
html,body,#app{height:100%}
body{background:var(--bg);}

/* topbar *
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 20px;
  background:linear-gradient(180deg, rgba(2,15,14,0.95), rgba(0,20,22,0.9));
  color:#dbeeea;
}
.topbar a{color:#cfeeea;text-decoration:none;margin-left:18px;font-size:14px}
.topbar-left{font-weight:700}/

/* action bar */
.actionbar{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 24px;
  background:transparent;
}
.btn{background:#203a3b;color:#fff;border:1px solid rgba(255,255,255,0.06);padding:8px 12px;border-radius:6px;cursor:pointer}
.btn.primary{background:var(--btn)}
.btn.danger{background:var(--danger)}
.btn.small{padding:6px 8px;font-size:12px}

/* search */
.searchBox{margin-left:auto;display:flex;gap:8px;align-items:center}
.searchBox input{padding:8px 10px;border-radius:6px;border:1px solid rgba(255,255,255,0.06);min-width:260px;background:#0b2020;color:#fff}

/* tiles container */
.tiles-container{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap:20px;
  padding:20px;
}

/* fixed tile */
.tile{
  background:linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border-radius:10px;
  padding:var(--tile-padding);
  height:var(--tile-height);
  display:flex;flex-direction:column;justify-content:space-between;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  transition:transform .15s ease, box-shadow .15s ease;
  cursor:pointer; position:relative; overflow:hidden;
}
.tile:hover{transform:translateY(-6px) scale(1.02); box-shadow:0 14px 30px rgba(0,0,0,0.7);}

/* tile colors */
.tile-red{background:linear-gradient(180deg,#f01832,#8f2b36)}
.tile-orange{background:linear-gradient(180deg,#f69d32,#d97c13)}
.tile-lightgreen{background:linear-gradient(180deg,#9adf86,#6fc55a)}
.tile-green{background:linear-gradient(180deg,#198a04,#33b37a)}
.tile-gray{background:linear-gradient(180deg,#bfc4c6,#9ea3a5)}

/* tile sections */
.tile-top{display:flex;justify-content:space-between;align-items:flex-start}
.tile-top .code{font-weight:700; font-size:14px}
.tile-top .meta{font-size:12px;opacity:0.95;display:flex;gap:10px}
.tile-middle{display:flex;align-items:center;justify-content:center;flex:1}
.tile-middle .days{font-size:34px;font-weight:800;color:rgba(255,255,255,0.95)}
.tile-bottom{font-size:12px;color:rgba(255,255,255,0.9);line-height:1.2;}

/* allow 2-line description in bottom section */
.tile-bottom div{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* modal baseline */
.modal{position:fixed;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;z-index:2000}
.modal.hide{display:none}
.modal .modal-content{width:85%;max-width:1100px;border-radius:12px;padding:18px;position:relative;box-shadow:0 20px 60px rgba(0,0,0,0.7);}

/* glass look */
.glass-blue{
  background: linear-gradient(180deg, rgba(7,28,40,0.55), rgba(6,24,36,0.6));
  border:1px solid rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
  color:#e6f7ff;
}

/* modal close */
.modal-close{position:absolute;right:18px;top:12px;background:transparent;border:none;color:#fff;font-size:28px;cursor:pointer}



/* form fields in modal */
.modal-content label{display:block;font-size:13px;margin-top:8px}
.modal-content input[type="text"], .modal-content input[type="number"], .modal-content input[type="date"], .modal-content select, .modal-content textarea{
  width:100%;padding:8px;border-radius:6px;border:1px solid rgba(255,255,255,0.06);background:rgba(0,0,0,0.15);color:#fff;margin-top:6px;
}
.modal-content textarea{min-height:60px;max-height:120px;resize:vertical}

/* modal actions */
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}

/* small lists (clients/suppliers) */
.list{max-height:520px;overflow:auto;padding:8px}
.list-row{display:flex;align-items:center;justify-content:space-between;padding:10px;border-bottom:1px solid rgba(255,255,255,0.03)}
.list-text{font-weight:600}

/* login page specifics */
.hero-page{background:url('/static/img/hero.png') center center/cover no-repeat fixed;height:100vh;overflow:hidden}
.site-logo{position:absolute;left:50%;top:18px;transform:translateX(-50%);height:500px;z-index:2}
.login-card{position:absolute;right:6%;top:50%;transform:translateY(-50%);width:470px;background:rgba(4,37,38,0.55);border-radius:10px;padding:22px;color:#e6f0f0;backdrop-filter:blur(6px);}
.login-card input, .login-card select{width:100%;padding:10px;margin:8px 0;border-radius:6px;border:none;background:rgba(0,0,0,0.15);color:#e6f0f0}
/* center align login headings & text */
.login-card h1,
.login-card h2,
.login-card h3,
.login-card p {
  text-align: center;
}
.btn-primary{background:#1e90ff;color:#fff;padding:8px 14px;border-radius:6px;border:none}
.btn-secondary{background:transparent;color:#dcdcdc;border:1px solid rgba(255,255,255,0.08);padding:8px 12px;border-radius:6px}
.modal-inner{width:520px;background:rgba(4,37,38,0.95);padding:20px;border-radius:10px;color:#e6f0f0}
.login-card .watermark{display:block;width:180px;margin:0 auto 12px auto;opacity:0.95}

/* toast */
.toast{position:fixed;right:20px;bottom:20px;background:#17384a;padding:12px 16px;border-radius:8px;color:#eaf7ff;z-index:3000}
.toast.error{background:#8a2430}

/* helpers */
.hidden{display:none}



/* ============================================================
   🔵 ENHANCEMENTS ADDED BELOW  
   (NO existing code modified above this line)
   ============================================================ */


/* 4:3 modal window (for Create User) */
.modal-4by1{
  width:82%;
  max-width:900px;
  aspect-ratio:4/3;
  padding:18px;
}

/* inline side-by-side fields (used in Create Project modal) */
.inline-row{
  display:flex;
  gap:8px;
  align-items:flex-end;
  margin-top:6px;
}

/* 4-column Create Project Modal layout */
.project-modal-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  align-items: start;
}
/* =========================================
   FIX: FORCE GRID POSITIONS (NO OVERLAP)
========================================= */

/* Equipment (LEFT - spans 2 rows) */
.equipment-section {
  grid-column: 1;
  grid-row: 1 / span 2;
}

/* Client & Supplier */
.client-section {
  grid-column: 2;
  grid-row: 1;
}

/* Dates */
.dates-section {
  grid-column: 3;
  grid-row: 1;
}

/* Pricing & Remarks (RIGHT - spans 2 rows) */
.pricing-section {
  grid-column: 4;
  grid-row: 1 / span 2;
}

/* Invoice History (center bottom) */
.invoice-history-section {
  grid-column: 2 / span 2;
  grid-row: 2;
}

/* responsive fallback */
@media (max-width:1100px){
  .project-modal-grid{
    grid-template-columns:repeat(2,1fr);
  }
}
@media (max-width:700px){
  .project-modal-grid{
    grid-template-columns:1fr;
  }
}
/* ============================================================
   PATCH — Apply readability ONLY to dashboard modals
   ============================================================ */

.card.section input,
.card.section select,
.card.section textarea,
.modal-content input,
.modal-content select,
.modal-content textarea {
    background: rgba(255,255,255,0.10) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
}

.card.section input::placeholder,
.card.section textarea::placeholder,
.modal-content input::placeholder,
.modal-content textarea::placeholder {
    color: rgba(255,255,255,0.55) !important;
}

/* Double shift hidden state */
#doubleShiftFields.hide {
    display: none !important;
}


/* ============================================================
   📌 TILE LAYOUT + BLUE COLOR (NEW)
   ============================================================ */

/* Blue glossy gradient for Breakdown + Active */
.tile-blue{
  background:linear-gradient(180deg,#4da3ff,#2563eb);
}

/* Center-align project code in top section */
.tile-top{
  justify-content:center;
  align-items:flex-start;
}

.tile-top .code{
  width:100%;
  text-align:center;
}

/* Middle row: left rental type, center days, right status */
.tile-middle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
}

.tile-middle-left{
  flex:1;
  text-align:left;
  font-size:13px;
  font-weight:700;
}

.tile-middle-center{
  flex:1;
  text-align:center;
  font-size:34px;
  font-weight:800;
}

.tile-middle-right{
  flex:1;
  text-align:right;
  font-size:13px;
}

/* Bottom description centered */
.tile-bottom{
  text-align:center;
}

/* ============================================================
   ✨ TILE GLOSS & GLOW ENHANCEMENT (ADDITIVE ONLY)
   ============================================================ */

/* glossy light reflection */
.tile::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(
    180deg,
    rgba(255,255,255,0.22),
    rgba(255,255,255,0.08),
    rgba(255,255,255,0)
  );
  pointer-events:none;
}

/* subtle inner depth */
.tile::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  pointer-events:none;
}

/* color-aware soft glow */
.tile-red{
  box-shadow:
    0 10px 26px rgba(184,59,74,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

.tile-orange{
  box-shadow:
    0 10px 26px rgba(246,157,50,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

.tile-lightgreen{
  box-shadow:
    0 10px 26px rgba(154,223,134,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

.tile-green{
  box-shadow:
    0 10px 26px rgba(113,216,154,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

.tile-blue{
  box-shadow:
    0 10px 26px rgba(77,163,255,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

.tile-gray{
  box-shadow:
    0 10px 22px rgba(180,180,180,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.05);
}
/* =========================================================
   Project Modal – Wider Identity Fields
   ========================================================= */

/* Project Code & Location should visually span full column */
#projectCode,
#location{
  width:100%;
  font-weight:600;
  letter-spacing:0.4px;
}
/* ============================================================
   GLOBAL DROPDOWN FIX (Dark UI – Transparent Selects)
   ============================================================ */

select{
  background: rgba(0,0,0,0.22) !important;
  color: #e6f0f0 !important;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  appearance: none;          /* remove native white UI */
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* dropdown arrow fix (keeps it visible on dark bg) */
select::-ms-expand{
  display:none;
}

/* dropdown list items */
select option{
  background: #13292b;
  color: #e6f0f0;
}
/* =========================================
   Edit Project – readonly but copyable
========================================= */

/* Allow text selection + horizontal scroll */
.edit-readonly {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

/* Re-enable text selection */
.edit-readonly::selection {
  background: rgba(30, 144, 255, 0.35);
}

/* Enable horizontal scrolling for long values */
.edit-readonly {
  white-space: nowrap;
  overflow-x: auto;
}

/* Scrollbar styling (subtle) */
.edit-readonly::-webkit-scrollbar {
  height: 6px;
}
.edit-readonly::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
}


/* ===============================
   USER MANAGEMENT ALIGNMENT
================================ */

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.user-email {
  font-weight: 600;
}

.user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* same size for role + delete */
.user-role {
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 110px;
  text-align: center;
}

.delete-user {
  min-width: 110px;
}

/* ===============================
   INVOICE HISTORY POSITION FIX
================================= */

/* ===== FIXED MODAL LAYOUT (FINAL CLEAN) ===== */

/* ROW 1 */
.equipment-section { grid-column: 1; grid-row: 1; }
.client-section    { grid-column: 2; grid-row: 1; }
.dates-section     { grid-column: 3; grid-row: 1; }
.pricing-section   { grid-column: 4; grid-row: 1; }

/* ROW 2 */
.invoice-history-section {
  grid-column: 2 / span 2;
  grid-row: 2;
}

.client-section,
.dates-section {
  align-self: start;
}

.equipment-section {
  grid-row: span 2;
}

.pricing-section {
  grid-column: 4;
  grid-row: 1;
  align-self: start;
}

/* table layout */
.invoice-row {
  display: grid;
  grid-template-columns: 120px 140px 120px;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.invoice-header {
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 10px;
}

.invoice-history-box {
  min-height: 160px;
  max-height: 220px;
  overflow-y: auto;
}

/* date input */
.invoice-col.date input {
  width: 130px;
}

/* button */
.invoice-col.action button {
  padding: 4px 8px;
  font-size: 12px;
}

.project-modal-grid > * {
  min-width: 0;
}

.active-link {
  color: #0ea5a1 !important;
  font-weight: 600;
}

/* ================================
   PROJECT FILES MODAL IMPROVEMENT
================================ */

.project-files-modal {
    max-width: 900px;
    width: 90%;
}

.project-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.project-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.project-file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Button Colors */

.btn-view {
    background: #2d8cf0;
    color: white;
}

.btn-download {
    background: #28a745;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-view:hover {
    background: #1c6ed5;
}

.btn-download:hover {
    background: #218838;
}

.btn-delete:hover {
    background: #c82333;
}

/* ================= OPERATOR FIELD WIDTH FIX (SAFE) ================= */

/* Target only operator rows inside project modal */
#projectModal .equipment-section .inline-row{
  display:flex;
  gap:8px;
}

/* Operator NAME → bigger */
#projectModal .equipment-section .inline-row > div:first-child{
  flex:0.6;
  min-width:0;
}

/* Operator CONTACT → smaller */
#projectModal .equipment-section .inline-row > div:last-child{
  flex:0.4;
  min-width:0;
}

/* VERY IMPORTANT: prevent overflow */
#projectModal input{
  width:100%;
  max-width:100%;
}