/* Central backoffice styles - backoffice.css
   Edit here to change look-and-feel for all backoffice pages
*/
:root{
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --muted: #64748b;
    --accent-blue-start: #3b82f6;
    --accent-blue-end: #2563eb;
    --green-soft-start: #60d68c;
    --green-soft-end: #2ea86a;
    --danger: #ef4444;
}

body{background:var(--bg);font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial}

/* ── Topbar ── */
.topbar{background:linear-gradient(135deg,var(--accent-blue-start),var(--accent-blue-end));padding:14px 24px;display:flex;align-items:center;justify-content:space-between}
.topbar .brand{color:#fff;font-weight:800;font-size:1.2rem;text-decoration:none}
.topbar .back-btn{color:rgba(255,255,255,0.85);text-decoration:none;font-size:0.9rem;display:flex;align-items:center;gap:6px}
.topbar .back-btn:hover{color:#fff}
.topbar .user-info{color:rgba(255,255,255,0.85);font-size:0.9rem}
.topbar .logout-btn{color:rgba(255,255,255,0.7);font-size:0.85rem;text-decoration:none;border:1px solid rgba(255,255,255,0.3);padding:5px 14px;border-radius:20px;margin-left:14px;transition:all .2s}
.topbar .logout-btn:hover{background:rgba(255,255,255,0.15);color:#fff}
.menu-btn{color:rgba(255,255,255,0.85);font-size:0.9rem;text-decoration:none;transition:color .2s}
.menu-btn:hover{color:#fff}

/* ── Page header ── */
.page-header{padding:20px 24px;background:var(--card-bg);border-bottom:1px solid #e2e8f0;display:flex;justify-content:space-between;align-items:center}
.page-header h1{font-size:1.5rem;font-weight:700;color:#1e293b;margin:0}

/* ── Buttons ── */
.btn-primary{background:linear-gradient(135deg,var(--accent-blue-start),var(--accent-blue-end));border:none;border-radius:10px;padding:12px 24px;font-weight:600;color:#fff}
.btn-primary:hover{opacity:0.95}
.btn-secondary{border-radius:10px;padding:12px 24px;font-weight:600}
.btn-danger{background:#ef4444;border:none;border-radius:10px;padding:12px 24px;font-weight:600}

/* ── Card containers (list pages) ── */
.customer-card,.machine-card,.technician-card{background:var(--card-bg);border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,0.06);margin:20px;overflow:hidden;padding:8px}

/* ── List items ── */
így most n.customer-item,.machine-item,.technician-item{padding:16px 20px;border-bottom:none;cursor:pointer;transition:background .15s;margin:10px 0;border-radius:8px;border:1px solid #e8edf4}
.customer-item:hover,.machine-item:hover,.technician-item:hover,.technician-card:hover{background:#f8fafc;cursor:pointer}
.customer-item:first-child,.machine-item:first-child,.technician-item:first-child{margin-top:4px}
.customer-item:last-child,.machine-item:last-child,.technician-item:last-child{margin-bottom:4px}

.customer-name,.machine-name{font-weight:600;color:#1e293b;font-size:1rem;margin-bottom:4px}
.customer-phone,.machine-customer{color:var(--muted);font-size:0.875rem;display:flex;align-items:center;gap:6px}
.customer-email{color:#3b82f6;font-size:0.875rem;margin-top:2px}
.customer-tech{color:#475569;font-size:0.875rem;margin-top:6px}
.machine-service{font-size:0.8rem;color:#dc2626;margin-top:4px;font-weight:500}
.machine-service.ok{color:#059669}

/* ── Customer/machine list action row ── */
.machine-actions{display:flex;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid #f1f5f9;width:100%}
.machine-actions .add-machine-btn{flex:2;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:linear-gradient(135deg,var(--green-soft-start),var(--green-soft-end));color:#fff;text-decoration:none;font-size:0.95rem;padding:8px 12px;border-radius:10px;border:none}
.machine-actions .delete-btn{flex:1;display:inline-flex;align-items:center;justify-content:center;color:var(--danger);text-decoration:none;font-size:0.95rem;padding:8px 12px;border-radius:10px;background:transparent;border:1px solid rgba(239,68,68,0.08)}
.machine-actions .add-machine-btn:hover{opacity:0.95}
.machine-actions .delete-btn:hover{background:rgba(239,68,68,0.04)}
.machine-actions .add-machine-btn,.machine-actions .delete-btn{min-width:0}
@media (max-width:420px){
  .machine-actions{flex-direction:column}
  .machine-actions .add-machine-btn,.machine-actions .delete-btn{width:100%;flex:none}
}

/* ── Phone link styling ── */
.customer-phone a{color:inherit;text-decoration:none}
.customer-phone a:hover{text-decoration:underline}

/* ── Technician card (list style) ── */
.technicians-list{margin:20px}
.technician-card{background:var(--card-bg);padding:12px 16px;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,0.06);margin-bottom:12px;cursor:pointer}
.technician-name{font-weight:600;color:#1e293b}
.technician-meta{color:#64748b;font-size:0.9rem}

/* ── Form card (edit / add pages) ── */
.form-card{background:#fff;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,0.1);margin:20px;padding:24px}
.form-card h1{font-size:1.5rem;font-weight:700;color:#1e293b;margin-bottom:24px}
.form-section-title{font-size:1rem;font-weight:700;color:#1e293b;margin:0 0 16px;padding-bottom:10px;border-bottom:1px solid #e5e7eb}
.form-label{font-weight:600;font-size:0.875rem;color:#374151;margin-bottom:6px}
.form-control,.form-select{border-radius:10px;border:2px solid #e5e7eb;padding:12px 14px;font-size:1rem}
.form-control:focus,.form-select:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,0.15)}
.is-invalid{border-color:#ef4444!important}
.invalid-feedback{font-size:0.8rem;color:#ef4444}
.actions{display:flex;gap:10px;margin-top:24px;padding-top:20px;border-top:1px solid #e5e7eb}
.customer-name-sub{color:#64748b;font-size:0.9rem;margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid #e2e8f0}
@media (max-width:576px){
  .form-card{margin:12px;padding:16px}
  .actions{flex-direction:column}
  .actions .btn{width:100%}
}

/* ── Sort tabs (list & form pages) ── */
.sort-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.sort-tabs a{padding:6px 12px;border-radius:20px;font-size:0.8rem;text-decoration:none;color:#64748b;background:#f1f5f9;transition:all .2s}
.sort-tabs a:hover{background:#e2e8f0}
.sort-tabs a.active{background:#3b82f6;color:#fff}

/* ── Machines section inside customer edit ── */
.machines-section{margin-bottom:0}
.machines-section h2{font-size:1.25rem;font-weight:700;color:#1e293b;margin-bottom:16px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:nowrap}
.machines-section h2 .btn-add-machine{margin-left:auto;white-space:nowrap;flex-shrink:0}
.machines-section .sort-tabs{margin-bottom:16px}
.machines-section .sort-tabs a{padding:4px 10px;font-size:0.75rem}
@media (max-width:576px){
  .machines-section h2{font-size:1.05rem;gap:8px}
  .machines-section h2 .btn-add-machine{font-size:0.8rem;padding:6px 10px}
}

/* ── Machine card inside customer edit ── */
.machine-card-inner{background:#f8fafc;border-radius:10px;padding:14px 16px;margin-bottom:10px;cursor:pointer;transition:background .15s;border:1px solid #e2e8f0}
.machine-card-inner:hover{background:#f1f5f9;border-color:#3b82f6}
.machine-card-inner:last-child{margin-bottom:0}
.machine-card-inner .machine-name{font-weight:600;color:#1e293b;font-size:0.95rem}
.machine-card-inner .machine-details{font-size:0.85rem;color:#64748b;margin-top:4px}
.machine-card-inner .machine-meta{font-size:0.8rem;color:#94a3b8;margin-top:6px}
.no-machines{text-align:center;padding:30px 20px;color:#64748b;background:#f8fafc;border-radius:10px;border:1px dashed #cbd5e1}
.btn-add-machine{background:linear-gradient(135deg,#10b981,#059669);border:none;border-radius:8px;padding:8px 16px;font-weight:600;font-size:0.875rem}

/* ── Machine add/edit form specifics ── */
.new-category-section{display:none;margin-top:12px;padding:12px;background:#f8fafc;border-radius:8px;border:1px solid #e2e8f0}
.existing-types-hint{font-size:0.8rem;color:#94a3b8;margin-top:4px}
.alert-info{background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;padding:12px 16px;color:#1e40af;font-size:0.875rem;margin-bottom:16px}

/* ── Empty state ── */
.empty-state{text-align:center;padding:60px 24px;color:#94a3b8}
.empty-state svg{width:64px;height:64px;margin-bottom:16px;color:#cbd5e1}
.empty-state h3{font-size:1.1rem;font-weight:600;color:#475569;margin-bottom:8px}
.empty-state p{font-size:0.875rem}

/* ── Dashboard – welcome & stats ── */
.welcome-section{padding:40px 24px;text-align:center}
.welcome-section h1{font-size:1.75rem;font-weight:800;color:#1e293b;margin-bottom:8px}
.welcome-section p{color:#64748b;font-size:1rem}
.quick-actions{display:flex;flex-direction:column;gap:16px;max-width:400px;margin:0 auto;padding:0 24px}
.quick-action-card{background:#fff;border-radius:16px;padding:20px;text-decoration:none;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:14px;box-shadow:0 1px 3px rgba(0,0,0,0.1);transition:transform .2s,box-shadow .2s;width:100%;text-align:left}
.quick-action-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,0.15)}
.quick-action-icon{width:56px;height:56px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:1.75rem;flex-shrink:0}

/* Color variants for quick-action cards */
.quick-action-card.blue .quick-action-icon{background:#dbeafe}
.quick-action-card.green .quick-action-icon{background:#dcfce7}
.quick-action-card.orange .quick-action-icon{background:#fed7aa}
.quick-action-card.gray .quick-action-icon{background:#e5e7eb}
.quick-action-card.purple .quick-action-icon{background:#e9d5ff}

/* Keep icons monochrome (white/neutral) */
.quick-action-icon i{color:#64748b}

.quick-action-content{text-align:left}
.quick-action-content h3{font-size:1.1rem;font-weight:600;color:#1e293b;margin:0 0 4px}
.quick-action-content p{font-size:0.875rem;color:#64748b;margin:0}
.stats-row{display:flex;justify-content:center;gap:40px;margin-top:32px;padding:0 24px;max-width:300px;margin-left:auto;margin-right:auto}
.stat-item{text-align:center;min-width:80px}
.stat-number{font-size:2rem;font-weight:800;color:#2563eb}
.stat-label{font-size:0.875rem;color:#64748b}

/* ── Dashboard mobile drawer ── */
.mobile-hamburger{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:transparent;border:1px solid rgba(255,255,255,0.15);color:rgba(255,255,255,0.9);padding:6px 10px;border-radius:8px;z-index:4}
.mobile-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.45);display:none;z-index:1040;touch-action:none}
.mobile-overlay.show{display:block}
.mobile-drawer{position:fixed;top:0;right:0;height:100vh;width:88%;max-width:360px;background:#fff;color:#0f172a;box-shadow:-16px 0 40px rgba(2,6,23,0.35);transform:translateX(100%);transition:transform 280ms cubic-bezier(.2,.9,.2,1);z-index:1050;padding:18px;display:flex;flex-direction:column;gap:12px}
.mobile-drawer.show{transform:translateX(0)}
.drawer-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.drawer-title{font-weight:700;color:#0f172a;font-size:1.05rem}
.drawer-close{background:transparent;border:none;font-size:1.25rem;line-height:1;padding:6px 8px;border-radius:8px;color:#0f172a}
.drawer-nav{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.drawer-nav a{display:flex;align-items:center;gap:12px;padding:12px 10px;border-radius:10px;color:#0f172a;text-decoration:none;background:linear-gradient(90deg,#f8fafc,#fff);border:1px solid #eef2ff00;transition:background .15s,transform .08s;font-weight:600;box-shadow:0 1px 2px rgba(2,6,23,0.04)}
.drawer-nav a:active{transform:translateY(1px)}
.drawer-nav a:hover{background:#f1f5f9}
.drawer-footer{margin-top:auto;border-top:1px solid #eef2ff;padding-top:12px;display:flex;flex-direction:column;gap:8px}
@media (max-width:420px){.mobile-drawer{width:94%}.drawer-nav a{padding:14px 12px;font-size:1rem}}

/* ── Dashboard topbar (3-column grid layout for centered brand) ── */
.topbar.dashboard{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}
.topbar.dashboard .brand{grid-column:2;justify-self:center;white-space:nowrap;text-align:center}
.right-controls{grid-column:3;justify-self:end;display:flex;align-items:center;gap:12px;z-index:3}
@media (max-width:576px){
  .welcome-section{padding:24px 16px}
  .welcome-section h1{font-size:1.4rem}
  .quick-actions{padding:0 16px}
  .topbar.dashboard{padding:10px 12px}
  .topbar.dashboard .brand{font-size:1rem}
}

/* ── Auth pages (login, forgot-password) ── */
.auth-body{background:linear-gradient(135deg,#1e3a5f 0%,#0f172a 100%);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.card{max-width:420px;width:100%;border:none;border-radius:20px;box-shadow:0 25px 60px rgba(0,0,0,0.4);overflow:hidden}
.card-body{padding:32px}
.card-header{background:linear-gradient(135deg,var(--accent-blue-start),var(--accent-blue-end));padding:20px 24px;color:#fff;border:none}
.card-header h1{color:#fff;font-size:1.3rem;font-weight:800;margin:0}
.card-header p{color:#fff;font-size:0.95rem;margin:6px 0 0;line-height:1.5}
.feedback-box{padding:14px 16px;border-radius:10px;font-size:0.9rem;border-left:4px solid;margin-bottom:20px;display:none}
.feedback-box.error{background:#fef2f2;color:#991b1b;border-color:#f87171}
.feedback-box.warning{background:#fffbeb;color:#92400e;border-color:#f59e0b}
.feedback-box.success{background:#ecfdf5;color:#065f46;border-color:#34d399}
.feedback-box.show{display:block;animation:fadeIn .3s ease}
.forgot-link{color:#6b7280;font-size:0.85rem;text-decoration:none}
.forgot-link:hover{color:#3b82f6;text-decoration:underline}
.eye-btn{position:absolute;right:12px;top:50%;transform:translateY(-50%);border:none;background:none;color:#9ca3af;cursor:pointer;padding:4px;z-index:2}
.eye-btn:hover{color:#374151}
.divider{border-top:1px solid #e5e7eb;margin:24px 0}
.hint{font-size:0.82rem;color:#6b7280;line-height:1.5}
@keyframes fadeIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}

/* ── Képszám badge (géplistában) ── */
.image-count-badge{display:inline-flex;align-items:center;gap:3px;font-size:0.75rem;font-weight:600;color:#3b82f6;background:#eff6ff;border:1px solid #bfdbfe;border-radius:12px;padding:1px 8px;margin-left:6px;vertical-align:middle}

/* ── Galéria szekció ── */
.gallery-section{margin-top:0}
.gallery-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;gap:12px;flex-wrap:wrap}
.btn-upload-trigger{background:linear-gradient(135deg,#10b981,#059669);border:none;border-radius:8px;padding:8px 16px;font-weight:600;font-size:0.875rem;color:#fff;cursor:pointer;transition:opacity .15s}
.btn-upload-trigger:hover{opacity:.9}

/* ── Feltöltő panel ── */
.upload-panel{display:none;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:16px;margin-bottom:20px}
.upload-panel.open{display:block}
.upload-dropzone{border:2px dashed #cbd5e1;border-radius:8px;background:#fff;transition:border-color .15s,background .15s;cursor:pointer}
.upload-dropzone.drag-over{border-color:#3b82f6;background:#eff6ff}
.upload-dropzone-inner{padding:24px 16px;text-align:center;pointer-events:none}
.upload-icon{font-size:2rem;display:block;margin-bottom:8px}
.upload-dropzone p{margin:4px 0;color:#64748b;font-size:0.875rem}
.upload-hint{font-size:0.78rem;color:#94a3b8}
.btn-choose-file{display:inline-block;margin-top:12px;padding:8px 18px;background:#3b82f6;color:#fff;border-radius:8px;font-size:0.875rem;font-weight:600;cursor:pointer;pointer-events:all}
.upload-desc-row{margin-top:12px}
.upload-actions-row{display:flex;gap:10px;margin-top:12px}
.upload-error{color:#dc2626;font-size:0.85rem;margin-top:8px;background:#fef2f2;border-radius:6px;padding:8px 12px}

/* ── Galéria rács ── */
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}
@media(max-width:480px){.gallery-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}}
.gallery-thumb-wrap{position:relative;border-radius:8px;overflow:hidden;background:#e2e8f0;aspect-ratio:4/3}
.gallery-thumb{width:100%;height:100%;object-fit:cover;cursor:pointer;display:block;transition:transform .15s}
.gallery-thumb:hover{transform:scale(1.03)}
.gallery-thumb-label{position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,.55);color:#fff;font-size:0.7rem;padding:3px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gallery-delete-btn{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;background:rgba(239,68,68,.85);border:none;color:#fff;font-size:0.7rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s}
.gallery-thumb-wrap:hover .gallery-delete-btn,.gallery-thumb-wrap:focus-within .gallery-delete-btn{opacity:1}
@media(hover:none){.gallery-delete-btn{opacity:1}}
.gallery-empty{grid-column:1/-1;text-align:center;padding:32px 16px;color:#94a3b8;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:8px}
.gallery-empty p{margin:0;font-size:0.875rem}

/* ── Lightbox ── */
.lightbox-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:1100}
.lightbox{position:fixed;inset:0;z-index:1110;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px}
.lightbox-close{position:fixed;top:12px;right:16px;background:rgba(255,255,255,.15);border:none;color:#fff;font-size:1.5rem;width:40px;height:40px;border-radius:50%;cursor:pointer;z-index:1111;display:flex;align-items:center;justify-content:center}
.lightbox-close:hover{background:rgba(255,255,255,.3)}
.lightbox-nav{position:fixed;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.15);border:none;color:#fff;font-size:2rem;width:44px;height:64px;border-radius:8px;cursor:pointer;z-index:1111;display:flex;align-items:center;justify-content:center;transition:background .15s}
.lightbox-nav:hover{background:rgba(255,255,255,.3)}
.lightbox-prev{left:8px}
.lightbox-next{right:8px}
.lightbox-inner{max-width:min(96vw,900px);width:100%;display:flex;flex-direction:column;align-items:center;gap:12px}
.lightbox-img{max-width:100%;max-height:70vh;border-radius:8px;object-fit:contain;box-shadow:0 8px 32px rgba(0,0,0,.4)}
.lightbox-meta{width:100%;background:rgba(255,255,255,.1);border-radius:8px;padding:12px 14px;color:#fff}
.lightbox-desc{font-weight:600;font-size:0.9rem;margin-bottom:4px}
.lightbox-date{font-size:0.8rem;color:rgba(255,255,255,.7);margin-bottom:10px}
.lightbox-desc-edit{display:flex;gap:8px;align-items:center}
.lightbox-desc-edit .form-control{background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.25);color:#fff}
.lightbox-desc-edit .form-control::placeholder{color:rgba(255,255,255,.5)}

/* ── Törlés megerősítő modal ── */
.delete-modal{position:fixed;inset:0;z-index:1120;display:flex;align-items:center;justify-content:center;padding:16px}
.delete-modal-box{background:#fff;border-radius:12px;padding:24px;max-width:360px;width:100%;box-shadow:0 8px 32px rgba(0,0,0,.2)}
.delete-modal-box h3{font-size:1.1rem;font-weight:700;color:#1e293b;margin:0 0 8px}
.delete-modal-box p{font-size:0.875rem;color:#64748b;margin:0}

/* Mobile: make list/cards full-bleed (edge-to-edge) for a better mobile experience
   Targets only small screens and list/card classes so desktop layouts remain unchanged.
   Uses a full-bleed technique that keeps internal padding so content doesn't touch the viewport edge.
*/
@media (max-width:576px){
  body.backoffice .customer-card, body.backoffice .machine-card, body.backoffice .technician-card{
    /* make the card span the full viewport width */
    position:relative;
    left:50%;
    right:50%;
    margin-left:-50vw;
    margin-right:-50vw;
    width:100vw;
    max-width:100vw;
    /* remove heavy rounded corners for flush look */
    border-radius:0;
    /* keep a subtle internal padding so content doesn't touch the edge */
    padding-left:14px;
    padding-right:14px;
    /* reduce prominent shadow which can look odd when full-bleed */
    box-shadow:0 1px 2px rgba(0,0,0,0.04);
  }

  /* items inside lists should keep compact spacing */
  body.backoffice .customer-item, body.backoffice .machine-item, body.backoffice .technician-item{margin:10px 0;border-radius:6px}

  /* page header and form card get slightly reduced side padding on mobile */
  body.backoffice .page-header, body.backoffice .form-card{padding-left:12px;padding-right:12px}

  /* machines-section inner cards should also be full width inside their container */
  body.backoffice .machine-card-inner{padding-left:12px;padding-right:12px}

  /* ensure mobile drawer and overlays are not affected visually */
  body.backoffice .mobile-drawer, body.backoffice .mobile-overlay{left:auto;right:auto}
}

