/* ================================
   CULORI ȘI VARIABILE GLOBALE
   ================================ */
:root {
  --main-bg: #f4f7fb;
  --sidebar-bg: linear-gradient(180deg, #1273c4 0%, #062341 100%);
  --sidebar-bg-collapsed: #223b61;
  --sidebar-text: #fff;
  --header-bg: linear-gradient(90deg, #1273c4 0%, #062341 100%);
  --footer-bg: linear-gradient(90deg, #12395c 0%, #062341 100%);
  --header-text: #fff;
  --primary: #2189ff;
  --primary-hover: #1c70d3;
  --border-radius: 12px;
}

/* ================================
   RESET & BAZĂ
   ================================ */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}
html, body, #layout {
  height: 100%;
  min-height: 100vh;
}
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--main-bg);
  color: #222;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
}

/* ================================
   STRUCTURĂ LAYOUT
   ================================ */
#layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: 100vw;
  overflow: hidden;
}
header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.3em 1.2em;      /* mai mic față de 0.8em */
  font-size: 1.3em;         /* mai mic față de 1.3em */
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  width: 100%;
  height: 38px;              /* setat fix, sau ajustează după preferință */
  box-sizing: border-box;
}
main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

/* ================================
   SIDEBAR & ICONIȚE
   ================================ */
#sidebar {
  width: 220px;
  min-width: 54px;
  max-width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: width 0.2s, min-width 0.2s;
  display: flex;
  flex-direction: column;
  padding-top: 1.1em;
  box-shadow: 1px 0 4px rgba(0,0,0,0.05);
  position: relative;
  z-index: 2;
  overflow: visible;
  height: 100%;
}
#sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
}
#sidebar li {
  margin: 0.3em 0;
}
#sidebar a {
  display: flex;
  align-items: center;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.7em 1.5em;
  border-radius: var(--border-radius);
  transition: background 0.17s, color 0.17s;
  font-size: 1.07em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sidebar a.active,
#sidebar a:hover {
  background: rgba(255,255,255,0.14);
  color: #e2eaff;
}
.sidebar-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.9em;
  font-size: 1.2em;
  color: #e2eaff;
  width: 1.7em;
  height: 1.7em;
  text-align: center;
}

/* === SIDEBAR COLAPSAT === */
#sidebar.collapsed {
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  overflow: visible;
}
#sidebar.collapsed a {
  justify-content: center;
  text-align: center;
  padding: 0.7em 0.2em;
  font-size: 1.3em;
}
#sidebar.collapsed .sidebar-label {
  display: none;
}
#sidebar.collapsed .sidebar-icon {
  margin: 0 auto;
  display: block;
  color: #fff;
}

/* ================================
   BUTON TOGGLE SIDEBAR (SVG)
   ================================ */
.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  right: -17px;
  transform: translateY(-50%);
  width: 34px;
  height: 44px;
  background: #e8f0fc;
  border-radius: 16px;
  border: 1px solid #c7d3ea;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  z-index: 10;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: right 0.2s, background 0.18s;
  padding: 0;
}
.sidebar-toggle-btn:hover {
  background: #d4e3f8;
}
.sidebar-toggle-btn svg {
  transition: transform 0.2s;
}
#sidebar.collapsed .sidebar-toggle-btn svg {
  transform: rotate(180deg);
}

/* ================================
   CONȚINUT PRINCIPAL
   ================================ */
#content {
  flex: 1 1 0%;
  padding: 2em 2.5em 1em 2.5em;
  background: var(--main-bg);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

/* ================================
   FOOTER
   ================================ */
footer {
  background: var(--footer-bg);
  color: #dbe8fb;
  padding: 0.25em 0.5em;   /* mai mic decât 0.7em 1.5em */
  text-align: center;      /* centrat */
  font-size: 0.7em;
  letter-spacing: 0.02em;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 28px;            /* fix sau după preferință */
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ================================
   FORMULARE & BUTTONS
   ================================ */
form {
  background: #fff;
  padding: 2em 2.2em;
  border-radius: var(--border-radius);
  max-width: 370px;
  margin: 2.5em auto;
  box-shadow: 0 2px 16px rgba(0,20,60,0.09);
}
input, button {
  font-size: 1em;
  padding: 0.65em 1em;
  border-radius: var(--border-radius);
  border: 1px solid #c3d0e8;
  margin-bottom: 1.2em;
  width: 100%;
  box-sizing: border-box;
}
button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.18s;
}
button:hover {
  background: var(--primary-hover);
}

/* ================================
   MESAJ ERORI/SUCCES
   ================================ */
#error-message, .error-message {
  color: #b6000c;
  background: #fff0f3;
  border-left: 4px solid #b6000c;
  padding: 0.5em 1em;
  border-radius: var(--border-radius);
  margin: 1em 0;
}
#success-message, .success-message {
  color: #157e23;
  background: #e3ffea;
  border-left: 4px solid #157e23;
  padding: 0.5em 1em;
  border-radius: var(--border-radius);
  margin: 1em 0;
}

tr.success { background-color: #e6ffe6; }
tr.warning { background-color: #fffbe6; }
tr.error   { background-color: #ffe6e6; }

.login-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 18px;
  margin-top: 10px;
  text-align: center;
  font-weight: 500;
  font-size: 1.05rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  min-height: 24px;
}


/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 900px) {
  #sidebar, #sidebar.collapsed { display: none; }
  main { flex-direction: column; }
  #content { padding: 1em 0.7em; }
}

/* HEADER: negru stânga, albastru dreapta */
header, #header {
  background: linear-gradient(90deg, #000 0%, #1273c4 100%);
  color: #fff;
}

/* SIDEBAR: negru sus, albastru jos */
#sidebar, .sidebar {
  background: linear-gradient(180deg, #000 0%, #1273c4 100%);
  color: #fff;
}

/* FOOTER: albastru stânga, negru dreapta */
footer, #footer {
  background: linear-gradient(90deg, #1273c4 0%, #000 100%);
  color: #fff;
}

/* Link-uri și iconițe pe alb în sidebar */
#sidebar a,
#sidebar a.active,
#sidebar a:hover,
.sidebar-icon {
  color: #fff;
}

/* Sidebar link activ - efect vizual la alegere */
#sidebar a.active {
  background: rgba(255,255,255,0.08);
  border-left: 3px solid #22b8ff;
}

.login-msg {
  background: #fff;
  border: 1.5px solid #e7e7e7;
  border-radius: 7px;
  color: #222;
  font-size: 1em;
  margin-bottom: 1.2em;
  padding: 0.8em 1em;
  box-shadow: 0 2px 9px 0 rgba(0,0,0,0.01);
  text-align: center;
}

.login-label {
  font-size: 1em;
  font-weight: 500;
  margin-bottom: 0.25em;
  margin-top: 0.75em;
  display: block;
  color: #193b65;
  letter-spacing: .02em;
}

.password-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  flex: 1;
  padding-right: 40px;
}
#toggle-password {
  background: none;
  border: none;
  position: absolute;
  right: 8px;
  top: 6px;
  cursor: pointer;
  padding: 0 5px;
  height: 28px;
  width: 28px;
  outline: none;
}

.login-btn {
  margin-top: 1.1em;
}

.login-warning {
  color: #c00;
  margin-top: 1em;
  font-size: 1em;
  background: #fff;
  border: 1.5px solid #ffd9d9;
  border-radius: 7px;
  padding: 0.7em 1em;
  text-align: center;
}

#arhiva-tablewrap {
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border-radius: 7px;
  box-shadow: 0 3px 18px #0001;
}

#arhiva-table { width: 100%; border-collapse: collapse; background: #fff; }
#arhiva-table thead th {
  position: sticky;
  top: 42px; /* cât are breadcrumbs-ul */
  background: #f3f3f3;
  z-index: 10;
  border-bottom: 1px solid #e1e1e1;
}
#arhiva-table td { padding: 6px 10px; border-bottom: 1px solid #e1e1e1; }
#arhiva-table th { background: #f3f3f3; }
.folder-link { color: #FBC02D; cursor: pointer; text-decoration: none; font-weight: 500; }
.file-link { color: #2874c6; text-decoration: none; }
.folder-link:hover, .file-link:hover { text-decoration: underline; }

.arhiva-zip-btn:hover { background: #1d4c8b; }

#arhiva-breadcrumbs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #f3f8ff;
  z-index: 11;
  padding: 10px 12px 8px 12px;
  font-size: 1.1em;
  border-bottom: 1px solid #e1e1e1;
}
.arhiva-breadcrumbs-left {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}
.arhiva-breadcrumbs-right {
  margin-left: 18px;
  flex-shrink: 0;
}
.arhiva-zip-btn {
  padding: 2px 12px 2px 7px;
  background: #2874c6;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  min-width: 0;
  box-shadow: 0 1px 5px #0001;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  font-weight: 500;
  transition: background 0.14s;
  margin-top: 10px ;
}
.arhiva-zip-btn:hover { background: #1d4c8b; }

@media (max-width:600px) {
  #arhiva-breadcrumbs { flex-direction: column; align-items: flex-start; gap: 8px;}
  .arhiva-zip-btn { width: 100%; margin-left: 0; }
}
