:root, [data-theme="light"] {
    --color-bg: #f7f6f2;
    --color-surface: #f9f8f5;
    --color-surface-2: #fbfbf9;
    --color-surface-offset: #f0ede8;
    --color-divider: #dcd9d5;
    --color-border: #d4d1ca;
    --color-text: #28251d;
    --color-text-muted: #7a7974;
    --color-text-faint: #bab9b4;
    --color-primary: #01696f;
    --color-primary-hover: #0c4e54;
    --color-primary-highlight: #cedcd8;
    --color-warning: #964219;
    --color-warning-highlight: #fef3ec;
    --color-success: #437a22;
    --color-success-highlight: #edf6e7;
    --color-error: #b91c1c;
    --color-error-highlight: #fef2f2;
    --color-folder: #c9a800;
    --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
    --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
    --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    --font-body: 'Inter', 'Helvetica Neue', sans-serif;
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
    --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"]{--color-bg:#171614;--color-surface:#1c1b19;--color-surface-2:#201f1d;--color-surface-offset:#1d1c1a;--color-divider:#262523;--color-border:#393836;--color-text:#cdccca;--color-text-muted:#797876;--color-text-faint:#5a5957;--color-primary:#4f98a3;--color-primary-hover:#227f8b;--color-primary-highlight:#313b3b;--color-warning:#bb653b;--color-warning-highlight:#2a1f14;  --color-folder: #806D00;--shadow-sm:0 1px 2px oklch(0 0 0/.2);--shadow-md:0 4px 12px oklch(0 0 0/.3);}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{-webkit-font-smoothing:antialiased;}
body{min-height:100dvh;font-family:var(--font-body);font-size:var(--text-base);color:var(--color-text);background:var(--color-bg);display:flex;flex-direction:column;}
a,button{transition:color var(--transition),background var(--transition),border-color var(--transition);text-decoration:none;}
button{cursor:pointer;background:none;border:none;font:inherit;color:inherit;}
.topbar{position:sticky;top:0;z-index:100;background:var(--color-surface);border-bottom:1px solid var(--color-border);box-shadow:var(--shadow-sm);display:flex;align-items:center;justify-content:space-between;padding:0.75rem 2rem;gap:1rem;}
.logo{display:flex;align-items:center;gap:0.75rem;color:var(--color-text);}
.logo-mark{width:36px;height:36px;background:var(--color-primary);border-radius:var(--radius-md);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.logo-name{font-size:var(--text-sm);font-weight:600;}
.logo-sub{font-size:var(--text-xs);color:var(--color-text-muted);}
.topbar-right{display:flex;align-items:center;gap:0.75rem;font-size:var(--text-sm);color:var(--color-text-muted);}
.layout{display:flex;flex:1;min-height:0;}
.sidebar{width:260px;flex-shrink:0;background:var(--color-surface);border-right:1px solid var(--color-border);padding:1.5rem 1rem;overflow-y:auto;display:flex;flex-direction:column;gap:0.5rem;}
.sidebar-label{font-size:var(--text-sm);font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-faint);padding:0 0.75rem 0.5rem;margin-top:1rem;
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 0.5rem;}
.sidebar-label:first-child{margin-top:0;}
.project-btn{display:flex;align-items:center;gap:0.75rem;padding:0.5rem 0.75rem;border-radius:var(--radius-md);font-size:var(--text-sm);font-weight:500;color:var(--color-text-muted);width:100%;cursor:pointer;}
.project-btn:hover{background:var(--color-surface-offset);color:var(--color-text);}
.project-btn.active{background:var(--color-primary-highlight);color:var(--color-primary);}
.project-icon{width:28px;height:28px;border-radius:var(--radius-sm);background:var(--color-surface-offset);display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:13px;}
.project-meta{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0;}
.project-meta span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.project-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.project-count{font-size:var(--text-xs);color:var(--color-text-faint);font-weight:400;}
.project-btn.active .project-count{color:var(--color-primary);opacity:0.7;}
.content{flex:1;overflow-y:auto;padding:2rem;padding-top:0.75rem;padding-bottom: calc(1rem + 49px); ;display:flex;flex-direction:column;gap:1.5rem;}
.btn-primary{
  display:inline-flex;
  align-items:right;
  gap:0.5rem;
  padding:0.5rem 1.25rem;
  background:var(--color-primary);
  color:white;
  border-radius:var(--radius-md);
  font-size:var(--text-sm);
  font-weight:600;
  white-space:nowrap;
  margin-bottom:1rem;}
.btn-primary:hover{background:var(--color-primary-hover);}
.btn-download {
  display: inline-flex;
  align-items: right;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--color-divider);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom:1rem;
}

.btn-download:hover {
  background: #dc3545;
}
#scroll-top-btn {
  position: fixed;
  bottom: calc(1rem + 49px); /* nad demo-barem */
  right: 3.25rem;
  z-index: 900;
  /* padding-bottom: calc(1rem + 49px); */
  display: flex;
  align-items: center;
  justify-content: center;

  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);

  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#scroll-top-btn:hover {
  background: var(--color-primary-hover, #1a7fd4);
  border-color: var(--color-primary-hover, #1a7fd4);
}
a.project-btn {
  color: var(--color-text-muted);
}
a.project-btn:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}
a.project-btn.active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
a.project-btn.active .project-count {
  color: var(--color-primary);
  /* opacity: 0.7; */
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: 0.25rem;
}
.breadcrumb a {
  color: var(--color-text-muted);
}
.breadcrumb a:hover {
  color: var(--color-primary);
}
.breadcrumb-sep {
  font-size: 0.65rem;
  opacity: 0.5;
}
.breadcrumb-current {
  color: var(--color-text-muted);
}
.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}
.upload-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.upload-copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 720px;
}

.upload-lead {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.6;
}

.upload-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.upload-hints span {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  border: 1px solid var(--color-border);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
}

.dropzone {
  position: relative;
  min-height: 420px;
  border-radius: 1.25rem;
  border: 1px solid var(--color-border);
  background:
    radial-gradient(circle at top, oklch(from var(--color-primary) l c h / 0.08), transparent 38%),
    linear-gradient(180deg, var(--color-surface), var(--color-surface-2));
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.dropzone::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 1rem;
  border: 1px dashed oklch(from var(--color-primary) l c h / 0.32);
  pointer-events: none;
}

.dropzone:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.35);
  transform: translateY(-1px);
}

.dropzone.dragover {
  background:
    radial-gradient(circle at top, oklch(from var(--color-primary) l c h / 0.16), transparent 42%),
    linear-gradient(180deg, var(--color-surface), var(--color-surface-offset));
}

.dropzone-icon {
  width: 108px;
  height: 108px;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(from var(--color-primary) l c h / 0.1);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px oklch(from var(--color-primary) l c h / 0.14);
}

.dropzone-title {
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 2rem);
  font-weight: 700;
  color: var(--color-text);
}

.dropzone-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.dropzone-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: white;
  font-weight: 700;
  font-size: var(--text-sm);
  box-shadow: 0 10px 30px oklch(from var(--color-primary) l c h / 0.22);
}

.dropzone-footer {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  max-width: 36ch;
}

.dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-info-card {
  border-radius: 1.25rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upload-info-card h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.upload-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.upload-info-list li {
  padding-left: 1rem;
  position: relative;
}

.upload-info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-primary);
}

.upload-submit {
  margin-top: auto;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  
}
.sidebar-info {
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-info-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.sidebar-info-value {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  /*font-weight: bold;*/
}
/*.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.75rem 0.5rem;
  border-top: 1px solid var(--color-divider);
}
.sidebar-footer-mockup {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 500;
}*/
.demo-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background:var(--color-surface);
  color:var(--color-text);
  padding: var(--space-3) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  gap: var(--space-4);
  z-index: 200;
}
/*.demo-bar-label{
  color: var(--color-text-faint);
}*/
.demo-bar-copyrights {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.server-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.server-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade8099;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}
.topbar-user {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
/* Hamburger — default - hidden on desktop */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.hamburger:hover {
  background: var(--color-surface-offset);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: 90;
}
.sidebar-overlay.active {
  display: block;
}

/* Restore icons and metadata in the drawer */
.sidebar .project-icon { display: flex !important; }
.sidebar .project-meta .project-count { display: block !important; }
.sidebar .sidebar-label { display: block !important; }
.sidebar .sidebar-info { display: flex !important; }
.sidebar-footer { display: block !important; }

.search-toggle {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: var(--radius-md);
color: var(--color-text-muted);
border: 1px solid var(--color-border);
flex-shrink: 0;
}
.search-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.45);
  z-index: 120;
}
.search-overlay.active {
  display: block;
}

.search-drawer {
  position: fixed;
  top: 56px;
  right: 16px;
  width: min(520px, calc(100vw - 32px));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  z-index: 130;
  display: none;
}
.search-drawer.active {
  display: block;
}

.search-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.search-drawer-header h2 {
  font-size: var(--text-base);
  font-weight: 700;
}

.search-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.search-close:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.search-form {
  margin-bottom: 1rem;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}

.search-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  color: var(--color-text);
}

.search-section-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: 0.5rem;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-result-item {
  display: block;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: var(--color-surface-2);
}
.search-result-item:hover {
  background: var(--color-surface-offset);
}

.content-login {
  flex: 1;
  display: flex;
  /* flex-direction: column; */
  justify-content: space-between;
  align-items: center;
}
.login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  width: min(420px, 100%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.login-title {
  font-size: var(--text-lg);
  font-weight: 700;
}
.login-error {
  background: var(--color-error-highlight);
  color: var(--color-error);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.login-field label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}
.login-field input {
  padding: 0.75rem 1rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
  color: var(--color-text);
  outline: none;
}
.login-field input:focus {
  border-color: var(--color-primary);
}
.login-submit {
  width: 100%;
  justify-content: center;
  padding: 0.85rem;
  margin-top: 0.5rem;
}
.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-logout:hover {
  background: var(--color-error-highlight);
  color: var(--color-error);
}
.folder-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-folder);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background var(--transition-interactive), border-color var(--transition-interactive);
    width: fit-content;
}
.folder-btn:hover {
    background: var(--color-surface-offset);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.folder-btn-icon { color: var(--color-primary); display: flex; }
.folder-btn-name { flex: 1; }
.folder-btn-count {
    font-weight: 400;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background: var(--color-surface-offset);
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
}
.folder-btn-arrow { color: var(--color-text-faint); display: flex; }
.folder-btn:hover .folder-btn-arrow { color: var(--color-primary); }
.content-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;}
.content-title{font-size:var(--text-xl);font-weight:700;letter-spacing:-0.02em;}
.content-subtitle{font-size:var(--text-sm);color:var(--color-text-muted);margin-top:0.25rem;}
.section-label{font-size:var(--text-xs);font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:var(--color-text-faint);display:flex;align-items:center;gap:0.75rem;}
.section-label::after{content:'';flex:1;height:1px;background:var(--color-divider);}
.files-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));gap:1rem;}
.file-card{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:1.25rem;display:flex;flex-direction:column;gap:0.75rem;box-shadow:var(--shadow-sm);position:relative;overflow:hidden;transition:box-shadow var(--transition),transform var(--transition);}
.file-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);}
.file-card.new::before{content:'';position:absolute;inset:0;border:2px solid var(--color-warning);border-radius:var(--radius-lg);pointer-events:none;}
.file-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:0.5rem;}
.file-type{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:var(--radius-md);font-size:var(--text-sm);font-weight:700;flex-shrink:0;}
.file-type.pdf {background: #fee2e2;color: #b91c1c;}
/* dwg and dxf share the same color intentionally — both are AutoCAD formats */
.file-type.dwg {background: #dbeafe;color: #1d4ed8;}
.file-type.xls {background: #dcfce7;color: #166534;}
.file-type.met {background: #fef3c7;color: #92400e;}
.file-type.ali {background: #ffe4e6;color: #9f1239;}
.file-type.rey {background: #ede9fe;color: #4c1d95;}
.file-type.txt {background: #f1f5f9;color: #334155;}
.file-type.doc {background: #dbeafe;color: #1e3a8a;}
.file-type.md {background: #f0fdf4;color: #065f46;}
.file-type.img {background: #ffedd5;color: #c2410c;}
.file-type.other {background: var(--color-text-muted);color: #fff;}
[data-theme="dark"] .file-type.pdf{background:#2a1010;color:#f87171;}
[data-theme="dark"] .file-type.dwg{background:#0f1d35;color:#60a5fa;}
.badge-new{font-size:var(--text-xs);font-weight:600;background:var(--color-warning-highlight);color:var(--color-warning);padding:2px 0.5rem;border-radius:var(--radius-full);white-space:nowrap;}
.file-bottom{margin-top:auto; display:flex; flex-direction:column; gap:0.35rem;}
.file-name{font-size:var(--text-sm);font-weight:600;line-height:1.4;padding-bottom:1rem;padding-top:0.25rem;overflow-wrap:anywhere; min-width:0;word-break: normal;}
.file-date{font-size:var(--text-xs);color:var(--color-text-muted);}
.file-uploader{font-size:var(--text-xs);color:var(--color-text-muted);padding-bottom:0.5rem;}
.btn-open{display:flex;width:100%;align-items:center;justify-content:center;gap:0.5rem;padding:0.5rem 0.75rem;background:var(--color-primary);color:white;border-radius:var(--radius-md);font-size:var(--text-xs);font-weight:600;}
.btn-open:hover{background:var(--color-primary-hover);}
.btn-open.dwg-btn{background:transparent;color:var(--color-primary);border:1px solid var(--color-primary);}
.btn-open.dwg-btn:hover{background:var(--color-primary-highlight);}
.project-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 400;
}
.file-uploader {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.messages-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    padding-bottom: calc(1rem + 49px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: opacity 600ms ease, transform 600ms ease;
}

.toast-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-surface-2);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-lg), 0 0 0 1px oklch(from var(--color-text) l c h / 0.06);
    font-size: var(--text-sm);
    min-width: 280px;
    max-width: 420px;
    border: 1px solid var(--color-border);
    animation: toast-in 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.toast-success {
    background: var(--color-success-highlight);
    border-left: 3px solid var(--color-success);
    color: var(--color-text);
}
.toast-error {
    background: var(--color-error-highlight);
    border-left: 3px solid var(--color-error);
    color: var(--color-text);
}
.toast-warning {
    background: var(--color-warning-highlight);
    border-left: 3px solid var(--color-warning);
    color: var(--color-text);
}

.toast-close {
    color: var(--color-text-muted);
    flex-shrink: 0;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
}
.toast-close:hover { color: var(--color-text); }
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 10px;
}
.log-row {
  display: flex;
  flex-direction: row; 
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
.log-action {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.log-upload { text-align: center;background: var(--color-primary-highlight); color: var(--color-primary);text-wrap:wrap; word-break: normal;;}
.log-update { text-align: center; background: var(--color-warning-highlight); color: var(--color-warning);text-wrap:wrap; word-break: normal;}
.log-delete { text-align: center; background: var(--color-error-highlight); color: var(--color-error);text-wrap:wrap; word-break: normal;}
.log-file { flex: 1; color: var(--color-text); text-overflow: ellipsis; text-wrap:wrap; word-break: normal; }
.log-meta { color: var(--color-text-faint); font-size: var(--text-xs); white-space: nowrap; text-wrap:wrap; word-break: normal; }
.logs-panel {
  border-top: 1px solid var(--color-divider);
  padding-top: 1rem;
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 1rem;
}

.logs-panel summary {
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  list-style: none;
}

.logs-panel summary::-webkit-details-marker {
  display: none;
}

.logs-panel[open] summary {
  margin-bottom: 1rem;
}
.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: var(--text-sm);
}
.login-checkbox-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding-left: 1.5rem;
}

/* POPUP NOTIFICATION */
.notification-demo {
  position: fixed;
  bottom: calc(1rem + 49px); right: var(--space-6);
  width: 340px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  z-index: 999;
  flex-direction: column; gap: var(--space-4);
  transform: translateY(0);
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.notif-header { display: flex; align-items: flex-start; gap: var(--space-3); }
.notif-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md); flex-shrink: 0;
  background: var(--color-warning-highlight);
  display: flex; align-items: center; justify-content: center;
}
@keyframes slideOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(16px); opacity: 0; }
}
.notif-icon svg { color: var(--color-warning); }
.notif-title { font-size: var(--text-sm); font-weight: 700; line-height: 1.3; }
.notif-body { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; line-height: 1.5; }
.notif-close {
  margin-left: auto; width: 28px; height: 28px;
  border-radius: var(--radius-sm); color: var(--color-text-faint);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-close:hover { background: var(--color-surface-offset); color: var(--color-text); }
.notif-actions { display: flex; gap: var(--space-2); }
.notif-btn-primary {
  flex: 1; padding: var(--space-2) var(--space-3);
  background: var(--color-primary); color: white;
  border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 600;
  text-align: center;
}
.notif-btn-primary:hover { background: var(--color-primary-hover); }
.notif-btn-secondary {
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 500;
}
.notif-btn-secondary:hover { background: var(--color-surface-offset); }
.notif-whatsapp {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--color-text-faint);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}
.wa-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #dcfce7; color: #15803d;
  border-radius: var(--radius-full);
  padding: 2px var(--space-2); font-size: 11px; font-weight: 600;
}
[data-theme="dark"] .wa-badge { background: #0f2a18; color: #4ade80; }

/* TOGGLE DEMO BAR */
.demo-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1c1b19; color: #cdccca;
  padding: var(--space-3) var(--space-8);
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-xs); gap: var(--space-4);
  z-index: 200;
}
.demo-bar-label { color: #797876; }
.demo-bar-actions { display: flex; gap: var(--space-3); }
.demo-action {
  padding: var(--space-1) var(--space-4);
  border: 1px solid #393836;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 500; color: #cdccca;
  cursor: pointer; white-space: nowrap;
}
.demo-action:hover { background: #262523; }
.demo-action.active-demo { background: var(--color-primary); border-color: var(--color-primary); color: white; }

/* WHATSAPP MOCK */
.wa-phone {
  position: fixed; bottom: 60px; left: var(--space-6);
  width: 280px;
  background: #111b21;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-body);
  display: none;
  z-index: 998;
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.wa-phone.visible { display: block; }
.wa-header {
  background: #202c33;
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
}
.wa-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #25d366; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white; font-weight: 700; flex-shrink: 0;
}
.wa-contact { font-size: 13px; font-weight: 600; color: #e9edef; }
.wa-online { font-size: 11px; color: #8696a0; }
.wa-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); min-height: 120px; background: #0b141a; }
.wa-msg {
  background: #202c33;
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  max-width: 90%; align-self: flex-start;
}
.wa-msg-text { font-size: 13px; color: #e9edef; line-height: 1.5; }
.wa-msg-time { font-size: 10px; color: #8696a0; margin-top: var(--space-1); text-align: right; }

/* MISC */
.empty-section {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--space-12); color: var(--color-text-faint);
  text-align: center; gap: var(--space-3);
}
.empty-section p { font-size: var(--text-sm); max-width: 30ch; }

/* ============================================================
   RESPONSIVE — mobile & tablet
   ============================================================ */

/* Tablet — sidebar narrows, content gains space */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
  .content {
    padding: 1.5rem;
    padding-bottom: calc(1rem + 49px); 
  }
  .demo-bar {
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
  }

  .demo-bar-copyrights {
    position: static;        /* turn absolute off on mobile */
    transform: none;
    font-size: 0.7rem;
    order: 3;                /* goes to the end */
  }

  .demo-bar-label {
    display: none;           /* label hidden - takes space */
  }
}
@media (max-width: 960px) {
  
  .login-wrap {
    padding:1rem;
    justify-content: flex-start;
    margin-top:100px;
  }
  .upload-layout {
    grid-template-columns: 1fr;
  }

  .dropzone {
    min-height: 360px;
  }
  .log-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .log-file {
    width: 100%;
    word-break: break-word;
  }
  .log-upload {flex:1; max-width:400px;}
  .log-update {flex:1; max-width:400px;}
  .log-delete {flex:1; max-width:400px;}

}
/* Mobile — full column */
@media (max-width: 768px) {

  .content-login {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  }
  .login-wrap {
    padding:1rem;
    justify-content: flex-start;
    margin-top:40px;
  }
  .login-card {
    padding:1rem 1.5rem;
    gap:0.5rem;
  }
  .login-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .btn-primary-login-submit {
    justify-content: center;
    margin-top: 0.5rem;
    margin-bottom:0.5rem;
  }
  /* Topbar */
  .topbar {
    padding: 0.65rem 1rem;
    gap: 0.5rem;
  }
  .logo-sub {
    display: none;
  }
  .server-status .server-text {
    display: none;
  }
  .server-dot {
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade8099;
  }
  .topbar-user {
    display: none; /* no space for username on small screens */
  }

  /* Layout — from row to column */
  .layout {
    flex-direction: column;
    min-height: 0;
  }

  /* Sidebar becomes a horizontal bar at the top */
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
    top: 0 !important;
    padding-top: 4.5rem !important; /* robi miejsce pod topbarem */
    height: 100dvh !important;
    /* hide sections INFO and labels */
  }
    /* Sidebar returns to the vertical drawer */
 .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-right: 1px solid var(--color-border) !important;
    border-bottom: none !important;
    padding: 1.5rem 1rem !important;
    padding-top: 4.5rem !important;
    gap: 0.5rem !important;
    z-index: 95;
    transform: translateX(-100%);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-label,
  .sidebar-info,
  .sidebar-footer {
    display: none;
  }
  .project-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-full);
    min-width: auto;
  }
  .project-icon {
    display: none;
  }
  .project-name{
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    display:-webkit-box;
    line-clamp:2;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }
  .project-meta .project-count {
    display: none;
  }

  /* Content */
  .content {
    padding: 1rem;
    gap: 1rem;
    padding-bottom: calc(2rem + 49px); /* 49px = height of demo bar */
  }

  /* Demo bar — simplify */
  .demo-bar {
    padding: var(--space-2) var(--space-4);
    font-size: 0.7rem;
  }
  /* Hamburger — show on mobile only */
  .hamburger {
    display: flex;
}
/* Hamburger button */
  .project-btn {
    flex-shrink: unset !important;
    white-space: normal !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
  }
  .search-drawer {
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    padding-top: 4.75rem;
  }
}

/* Small mobile < 480px */
@media (max-width: 480px) {

  .login-wrap {
    padding:1rem;
    justify-content: flex-start;
    margin-top:0px;
  }
  .topbar {
    padding: 0.5rem 0.75rem;
  }
  .logo-name {
    font-size: var(--text-xs);
  }
  .content {
    padding: 0.75rem;
    padding-bottom: calc(1rem + 49px);
  }
  .log-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .log-file {
    width: 100%;
    word-break: break-word;
  }
  .log-upload {flex:1; max-width:400px;}
  .log-update {flex:1; max-width:400px;}
  .log-delete {flex:1; max-width:400px;}
}
