/* ==== BASE ==== */
:root {
  --bg-color: #f9fafb;
  --text-color: #111827;
  --muted-text: #6b7280;
  --border-color: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 8px;
  --transition: 180ms ease;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ==== MESS ==== */

.mess_att {
    border: 2px solid red;
    padding: 10px;
    margin: 10px;
    background-color: #ffdede;
    border-radius: 5px;
}

.mess_ok {
    border: 2px solid green;
    padding: 10px;
    margin: 10px;
    background-color: #daedd9;
    border-radius: 5px;
}

.line {
    text-align: center;
    min-height: 6px;
    width: 100%;
    background-color: #d3e8ff;
    margin: 20px 0 0 0;
}

.notice {
    overflow: hidden;
    width: 100px;
    height: 25px;
    border-radius: 2px;
    background: #d5d5d5;
}

.td_mess_att {
    color: red;
}

.sp_red {
color: red;
}

.sp_green {
color: green;
font-weight: bold;
}


.st_b {
background: #e4f1ff;
border: 1px solid #87c1ff;
border-radius: 4px;
padding: 0 2px 0 2px;
margin: 0 2px 0 2px;
text-align: center;
}

.st_g {
background: #e9ffe7;
border: 1px solid #54ff54;
border-radius: 4px;
padding: 0 2px 2px 2px;
margin: 0 2px 0 2px;
text-align: center;
}

.st_y {
background: #fdffe4;
border: 1px solid #ffe932;
border-radius: 4px;
padding: 0 2px 2px 2px;
margin: 0 2px 0 2px;
text-align: center;
}

.st_o {
background: #ffdabc;
border: 1px solid #ffb279;
border-radius: 4px;
padding: 0 2px 2px 2px;
margin: 0 2px 0 2px;
text-align: center;
}

.st_r {
background: #ffe0e0;
border: 1px solid #ff9090;
border-radius: 4px;
padding: 0 2px 2px 2px;
margin: 0 2px 0 2px;
text-align: center;
}

form {
  max-width: 100%;
  margin: 5px auto;
  padding: 5px;
  background: #f9f9f9;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: system-ui, sans-serif;
}

/* Метки */
label {
  display: block;
  margin-bottom: 6px;
  color: #333;
}

/* Поля ввода */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

/* Фокус */
input:focus,
select:focus,
textarea:focus {
  border-color: #007bff;
  box-shadow: 0 0 3px rgba(0, 123, 255, 0.5);
  outline: none;
}

/* Кнопки */
button,
input[type="submit"] {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover,
input[type="submit"]:hover {
  background: #0056b3;
}





/* ==== GENERAL ==== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 20px;
}

/* ==== TEXT ==== */
h1, h2, h3, h4, h5 {
  margin-top: 0;
  color: var(--text-color);
}

p {
  margin: 0 0 1em;
  color: var(--text-color);
}

.text-muted {
  color: var(--muted-text);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* ==== LINKS ==== */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ==== TABLES ==== */
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  font-size: 0.8em;
}

thead {
  background: #f3f4f6;
}

th, td {
  padding: 1px 1px;
  border-bottom: 1px solid var(--border-color);
/*  text-align: left;*/
}

.td_f_name {
    text-align: right;
  padding: 1px 5px 1px 1px;
    color: #858585;
}

th {
  font-weight: 600;
  color: var(--text-color);
}

.tr_alert {
  background: #fffee3;
}

.tr_good {
  background: #e9ffe7;
}

tbody tr:hover {
  background: #ececec;
}

tfoot td {
  font-weight: bold;
}

/* ==== UTILITS ==== */
.container {
  max-width: 1000px;
  margin: 0 auto;
}

.card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}



/* ==== ADAPTATION ==== */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  th {
    display: none;
  }

  td {
    padding: 10px;
    border: none;
    border-bottom: 1px solid var(--border-color);
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted-text);
    display: block;
    margin-bottom: 4px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}
