
/* ============================================
   MTech Custom Theme — main.css
   ============================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-base:        #0d141d;
  --bg-panel:       #111a24;
  --bg-card:        #141f2b;
  --bg-input:       #0f1923;
  --border:         rgba(255,255,255,0.08);
  --border-green:   rgba(34,197,94,0.25);
  --green:          #22c55e;
  --green-dim:      #16a34a;
  --green-glow:     rgba(34,197,94,0.15);
  --red:            #e64a4a;
  --text-primary:   #f2f6fa;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --shadow:         0 4px 24px rgba(0,0,0,0.3);
}

html {
  font-size: 14px;
  overflow-anchor: none;
  scroll-behavior: auto;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.875rem; }
h6 { font-size: 0.75rem; }

a {
  color: var(--green);
  text-decoration: none;
}
a:hover {
  color: #4ade80;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- LAYOUT ---------- */
.mtech-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.mtech-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.mtech-main {
  flex: 1;
}

.mtech-main .mtech-container {
  padding-top: 0;
  padding-bottom: 24px;
}

/* Prevent module content from stretching full width */
#content-wrapper {
  max-width: 100%;
}

.page-wrapper,
.page-content {
  max-width: 100%;
}

/* ---------- HEADER ---------- */
.mtech-header {
  background: #0a1018;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 100;
}

.mtech-header-top {
  display: flex;
  align-items: center;
  height: 58px;
  gap: 24px;
}

.mtech-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mtech-logo img {
  height: 36px;
  width: auto;
}

.mtech-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.mtech-logo-text span {
  color: var(--green);
}

/* Status bar */
.mtech-status-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  padding-left: 24px;
  white-space: nowrap;
}

.mtech-status-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  font-family: monospace;
  width: 110px;
}

.mtech-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mtech-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  flex-shrink: 0;
}

.mtech-status-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  width: 70px;
  display: inline-block;
}

.mtech-status-time {
  font-size: 16px;
  font-weight: 700;
  font-family: monospace;
  color: #fff;
  width: 85px;
  display: inline-block;
}

.mtech-status-ferme {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: monospace;
  width: 150px;
  display: inline-block;
}

/* Header right */
.mtech-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mtech-credits {
  background: var(--green-glow);
  border: 1px solid var(--border-green);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

.mtech-user {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mtech-header-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.mtech-header-icon:hover {
  border-color: var(--border-green);
  color: var(--green);
}

.mtech-flag img {
  width: 22px;
  height: auto;
  border-radius: 2px;
}

/* Navigation */
.mtech-nav {
  background: #08111a;
  border-bottom: 1px solid var(--border);
}

.mtech-nav-inner {
  display: flex;
  align-items: center;
  height: 44px;
  gap: 4px;
}

.mtech-nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.mtech-nav-link:hover,
.mtech-nav-link.active {
  background: var(--green-glow);
  color: var(--green);
}

/* ---------- FOOTER ---------- */
.mtech-footer {
  background: #08111a;
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: auto;
}

.mtech-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- BUTTONS ---------- */
.mtech-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.mtech-btn-primary {
  background: var(--green);
  color: #071018;
}
.mtech-btn-primary:hover {
  background: #4ade80;
}

.mtech-btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.mtech-btn-outline:hover {
  border-color: var(--border-green);
  color: var(--green);
}

.mtech-btn-danger {
  background: rgba(230,74,74,0.1);
  border: 1px solid rgba(230,74,74,0.3);
  color: var(--red);
}

/* ---------- PANELS ---------- */
.mtech-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.mtech-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mtech-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.mtech-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--green);
  color: #071018;
}

/* ---------- FORMS ---------- */
.mtech-input,
.mtech-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}

.mtech-input:focus,
.mtech-select:focus {
  border-color: var(--border-green);
}

.mtech-input::placeholder {
  color: var(--text-muted);
}

.mtech-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mtech-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ---------- UTILITIES ---------- */
.mtech-green { color: var(--green); }
.mtech-red   { color: var(--red); }
.mtech-muted { color: var(--text-muted); }

.mtech-flex   { display: flex; }
.mtech-center { display: flex; align-items: center; justify-content: center; }

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34,197,94,0.3); }

/* ===== MODULE: MTech File Service ===== */
.mtechv2-shell {
  max-width: 1100px;
  margin: 0 auto;
}

.mtechv2-shell {
  max-width: 1100px !important;
  margin: 0 auto !important;
}

/* ===== LAYOUT ===== */
.mtech-content-col {
  max-width: 1150px;
}

.mtech-page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}


/* ============================================
   MTech — MOBILE STYLES (≤ 768px)
   Добавлено: адаптив для смартфонов
   НЕ ТРОГАЕТ десктоп-стили выше
   ============================================ */

@media (max-width: 768px) {

  /* ---------- CONTAINER ---------- */
  .mtech-container,
  .mtech-page-wrapper {
    padding: 0 12px;
  }

  /* ---------- HEADER: верхняя строка ---------- */
  .mtech-header-top {
    height: auto;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
  }

  /* Лого + правая часть в одну строку */
  .mtech-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    padding: 0 12px;
  }

  .mtech-logo img {
    height: 28px;
  }

  .mtech-logo-text {
    font-size: 15px;
  }

  /* Статус-бар — отдельная строка под лого */
  .mtech-status-bar {
    width: 100%;
    padding: 6px 12px;
    gap: 10px;
    border-top: 1px solid var(--border);
    background: #08111a;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mtech-status-bar::-webkit-scrollbar { display: none; }

  .mtech-status-label {
    font-size: 10px;
    letter-spacing: 1px;
    width: auto;
  }

  .mtech-status-text {
    font-size: 12px;
    letter-spacing: 1px;
    width: auto;
  }

  .mtech-status-time {
    font-size: 13px;
    width: auto;
  }

  .mtech-status-ferme {
    font-size: 10px;
    width: auto;
    white-space: nowrap;
  }

  /* Credits — компактнее */
  .mtech-credits {
    font-size: 12px;
    padding: 4px 10px;
  }

  /* Иконки — чуть меньше */
  .mtech-header-icon {
    width: 28px;
    height: 28px;
  }

  /* Имя пользователя скрываем на маленьких экранах */
  .mtech-user {
    display: none;
  }

  /* Флаги */
  .mtech-flag img {
    width: 18px;
  }

  /* ---------- НАВИГАЦИЯ ---------- */
  .mtech-nav-inner {
    height: auto;
    padding: 6px 0;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .mtech-nav-inner::-webkit-scrollbar { display: none; }

  .mtech-nav-link {
    font-size: 12px;
    padding: 6px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ---------- FOOTER ---------- */
  .mtech-footer-inner {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  /* ---------- PANELS ---------- */
  .mtech-panel {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  /* ---------- BUTTONS ---------- */
  .mtech-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* ---------- FILE SERVICE MODULE ---------- */
  .mtechv2-shell {
    padding: 0 4px;
  }

  /* ---------- ОБЩИЙ КОНТЕНТ ---------- */
  .mtech-main .mtech-container {
    padding-bottom: 16px;
  }
}

/* ============================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (≤ 380px)
   ============================================ */

@media (max-width: 380px) {
  .mtech-logo-text {
    font-size: 13px;
    letter-spacing: 0.5px;
  }

  .mtech-credits {
    font-size: 11px;
    padding: 3px 8px;
  }

  .mtech-header-right {
    gap: 6px;
  }

  .mtech-status-bar {
    gap: 8px;
  }
}
