/* Geotehnologija Mail — стилови (темен, во духот на geotehnologija.mk) */
:root {
  --bg-0: #06101d;
  --bg-1: #0b1626;
  --bg-2: #102035;
  --card: rgba(255,255,255,0.055);
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);
  --text: #eef5fc;
  --muted: #b9c9d9;
  --muted-2: #8fa7bf;
  --accent: #4da8ff;
  --accent-2: #76d8ff;
  --gold: #d4af37;
  --gold-2: #f0d36d;
  --green: #39d98a;
  --red: #e74c3c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 15% -10%, rgba(212,175,55,0.12), transparent 40%),
    radial-gradient(ellipse at 85% 0%, rgba(77,168,255,0.14), transparent 42%),
    linear-gradient(180deg, #040a14, #06101d 40%, #081527);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------- Копчиња ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #2f80ed, #7b61ff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(47,128,237,0.30);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger { background: rgba(231,76,60,0.16); border-color: rgba(231,76,60,0.45); color: #ffd3cd; }
.btn-danger:hover { background: rgba(231,76,60,0.30); }
.btn-ghost { background: rgba(255,255,255,0.06); }
.btn-small { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Флеш ---------- */
.flash {
  margin: 12px 18px;
  padding: 11px 15px;
  border-radius: 11px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.flash.ok { background: rgba(57,217,138,0.12); border-color: rgba(57,217,138,0.4); color: #b9f5d8; }
.flash.err { background: rgba(231,76,60,0.12); border-color: rgba(231,76,60,0.4); color: #ffc9c2; }

.muted { color: var(--muted-2); font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------- Логин ---------- */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  width: min(100%, 400px);
  padding: 36px 30px;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(14,30,55,0.92), rgba(9,18,38,0.92));
  box-shadow: 0 22px 60px rgba(0,0,0,0.5);
  text-align: center;
}
.login-logo {
  width: 62px; height: 62px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--gold), #8e6b12);
  box-shadow: 0 12px 28px rgba(212,175,55,0.30);
}
.login-card h1 { margin: 0; font-size: 1.6rem; }
.login-sub { margin: 4px 0 22px; color: var(--muted); font-size: 13.5px; }
.login-card form { text-align: left; }
.login-card label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 10px 0 5px;
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,168,255,0.18); }
.login-card .btn { margin-top: 18px; }
.login-card .home-btn { margin-top: 10px; }
.login-card .home-btn:hover { background: rgba(212,175,55,0.16); color: var(--gold-2); }

/* ---------- Распоред ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--border);
  background: rgba(6,15,27,0.75);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 9px; font-size: 1.15rem; font-weight: 800; padding: 2px 6px; }
.brand-ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), #8e6b12);
  box-shadow: 0 8px 18px rgba(212,175,55,0.25);
}

.compose-btn { margin-top: 2px; }

.folders { display: flex; flex-direction: column; gap: 3px; }
.folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: #dbe7f5;
}
.folder:hover { background: rgba(255,255,255,0.07); }
.folder.active { background: linear-gradient(135deg, rgba(47,128,237,0.9), rgba(123,97,255,0.85)); color: #fff; }
.unread-badge {
  background: var(--gold);
  color: #241c03;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 8px;
}

.quota { margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); }
.quota-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.quota-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,0.10); overflow: hidden; }
.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transition: width 0.4s ease;
}
.quota-warn { margin: 8px 0 0; font-size: 11.5px; color: #ffc9a3; }

.sidebar-foot { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Главен дел ---------- */
.content { flex: 1; min-width: 0; padding: 0 0 30px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,15,27,0.70);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.topbar .brand { font-size: 1.05rem; }
.topbar-left h1 { margin: 0; font-size: 1.3rem; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(143,124,255,0.14);
  border: 1px solid rgba(143,124,255,0.4);
  color: #cfc3ff;
  font-size: 12.5px;
  font-weight: 700;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  flex-wrap: wrap;
}
.search-form { display: flex; gap: 8px; flex: 1; max-width: 480px; }
.search-form input {
  flex: 1;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.search-form input:focus { border-color: var(--accent); }

/* ---------- Листа на пораки ---------- */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.move-select {
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #10203a;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
}

.msg-list { width: 100%; border-collapse: collapse; }
.msg-list td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13.5px; vertical-align: middle; }
.msg-list tr.unread { background: rgba(77,168,255,0.07); }
.msg-list tr.unread .from, .msg-list tr.unread .subj { font-weight: 800; color: #fff; }
.msg-list tr:hover { background: rgba(255,255,255,0.04); }
.msg-list .chk { width: 34px; }
.msg-list .from { width: 190px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dbe7f5; }
.msg-list .subj { color: #cfddee; }
.msg-list .subj a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.msg-list .date { width: 110px; text-align: right; color: var(--muted-2); white-space: nowrap; }
.msg-list .size { width: 70px; text-align: right; color: var(--muted-2); white-space: nowrap; }
.msg-list .empty { text-align: center; padding: 40px 10px; color: var(--muted-2); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Читање ---------- */
.view-wrap, .compose-wrap { max-width: 900px; margin: 0 auto; padding: 18px; }
.view-tools { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.message {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13,28,52,0.85), rgba(8,19,38,0.8));
  padding: 22px;
}
.msg-subject { margin: 0 0 14px; font-size: 1.35rem; }
.msg-head { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.05); font-size: 13.5px; margin-bottom: 14px; }
.msg-atts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 13px; }
.att-chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.4);
  color: var(--gold-2);
  font-weight: 700;
}
.att-chip:hover { background: rgba(212,175,55,0.25); }
.msg-body .pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0;
}

/* ---------- Компонирање ---------- */
.compose-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.compose { display: flex; flex-direction: column; gap: 10px; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row label { width: 56px; flex: 0 0 56px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted-2); }
.field-row input,
.compose textarea,
.stack input,
.stack select {
  flex: 1;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.compose textarea { resize: vertical; line-height: 1.6; }
.field-row input:focus, .compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,168,255,0.15); }
.att-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.att-row input[type="file"] { flex: 1; color: var(--muted); font-size: 13px; }
.compose-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.spacer { flex: 1; }
.small-note { margin-top: 10px; }

/* ---------- Админ ---------- */
.admin-wrap, .settings-wrap { max-width: 1100px; margin: 0 auto; padding: 22px 18px; }
.admin-wrap h2, .settings-wrap h2 { margin: 0 0 14px; }
.admin-cols { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .admin-cols { grid-template-columns: 1fr; } }

.panel {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13,28,52,0.85), rgba(8,19,38,0.8));
  padding: 20px;
}
.panel h3 { margin: 0 0 14px; }

.stack { display: flex; flex-direction: column; gap: 6px; }
.stack label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted-2); margin-top: 8px; }
.stack .btn { margin-top: 14px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: rgba(77,168,255,0.16); color: #9ed4ff; }
.badge-gold { background: rgba(212,175,55,0.16); color: var(--gold-2); }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .msg-list .from, .msg-list .date, .msg-list .size { display: none; }
}
