/* ============================================
   СУР — в стиле bpviz (v1.0)
   ============================================ */

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* { box-sizing: border-box; }
* { accent-color: #2e7d32; }
body {
    margin: 0; padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    background: #e0e0e0;
    color: #333;
    line-height: 1.4;
    color-scheme: light;
}
a { color: #555; text-decoration: none; }
a:hover { color: #333; text-decoration: underline; }
h1 { color: #333; font-size: 20px; margin-top: 0; }
h2 { color: #333; font-size: 16px; margin-top: 20px; }

/* ========== НАВИГАЦИЯ ========== */
.sur-nav {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #d7d7d7;
    font-size: 15px;
    position: sticky; top: 0; z-index: 50;
}
.sur-nav a { color: #555; text-decoration: none; white-space: nowrap; font-weight: 500; }
.sur-nav a:hover { color: #333; text-decoration: underline; }
.sur-nav .nav-sep { color: #ccc; user-select: none; }
.sur-nav i { color: #2e7d32; font-size: 16px; margin-right: 2px; }

/* ========== КОНТЕЙНЕР ========== */
.sur-container {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #d7d7d7;
    margin: 16px;
}

/* ========== ВКЛАДКИ ========== */
.sur-tabs {
    display: flex; gap: 4px;
    margin: 15px 0; padding: 10px 0;
    border-bottom: 2px solid #d7d7d7;
}

/* ========== КНОПКИ ========== */
.btn {
    display: inline-block; padding: 6px 14px;
    border: 1px solid #d7d7d7; border-radius: 4px;
    cursor: pointer; font-size: 13px; margin: 2px;
    text-decoration: none; line-height: 1.4;
    background: #fff; color: #555;
}
.btn:hover { background: #f0f0f0; text-decoration: none; }
.btn-primary { background: #555; color: #fff; border-color: #555; }
.btn-primary:hover { background: #444; }
.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-secondary { background: #f9f9f9; color: #555; border-color: #d7d7d7; }
.btn-success { background: #28a745; color: #fff; border-color: #28a745; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }

/* ========== ТАБЛИЦЫ ========== */
.sur-table {
    border-collapse: collapse; width: 100%; margin: 0; font-size: 13px;
}
.sur-table th {
    background: #2e7d32; color: #fff;
    border-left: 1px solid #1b5e20;
    border-right: 1px solid #1b5e20;
    padding: 8px 10px; text-align: left; font-size: 13px;
    font-weight: 600; white-space: nowrap;
}
.sur-table td {
    border: 1px solid #c0c0c0; padding: 6px 10px;
    font-size: 13px; vertical-align: top;
}
.sur-table tbody tr:nth-child(even) { background: #fafafa; }
.sur-table tbody tr:hover { background: #f5f5f5; }
.sur-table .saved-flash { animation: saveFlash 0.6s ease; }
@keyframes saveFlash {
    0% { background: #c8e6c9; }
    100% { background: transparent; }
}
.time-field-missing { background: #ffebee !important; }
.time-field-hidden { display: none; }

/* ========== ФОРМЫ ========== */
input[type="text"], input[type="date"], input[type="time"],
input[type="number"], input[type="password"], input[type="email"],
textarea, select {
    font-family: inherit; font-size: 13px; padding: 5px 8px;
    border: 1px solid #ccc; border-radius: 4px; background: #fff;
}
input:focus, textarea:focus, select:focus {
    border-color: #555; outline: none; box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}
input[type="checkbox"] { accent-color: #2e7d32; transform: scale(1.1); }
input[type="time"] { accent-color: #2e7d32; }
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(30%) sepia(80%) saturate(500%) hue-rotate(80deg); }
input[type="date"] { accent-color: #2e7d32; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(30%) sepia(80%) saturate(500%) hue-rotate(80deg); }

/* ========== КАРТОЧКИ-СУММАРИ ========== */
.summary { display: flex; gap: 20px; flex-wrap: wrap; margin: 15px 0; }
.summary-card { padding: 15px; border-radius: 6px; min-width: 200px; text-align: center; }
.summary-card .count { font-size: 32px; font-weight: bold; }
.card-deleted { background: #d4edda; border: 1px solid #c3e6cb; }
.card-error { background: #f8d7da; border: 1px solid #f5c6cb; }
.card-info { background: #d1ecf1; border: 1px solid #bee5eb; }

/* ========== СТАТУСЫ ========== */
.status-ok { color: #28a745; font-size: 13px; margin: 3px 0; }
.status-error { color: #dc3545; font-size: 13px; }
.status-warn { color: #ffc107; font-size: 13px; }

/* ========== КАЛЕНДАРЬ ========== */
table.calendar { border-collapse: collapse; margin: 0 auto; }
table.calendar th {
    background: #f9f9f9; color: #555; padding: 6px 8px;
    font-size: 12px; text-align: center; width: 36px; font-weight: 600;
}
.cal-day { border: 1px solid #ddd; padding: 8px 6px; text-align: center; font-size: 13px; cursor: pointer; user-select: none; }
.cal-day:hover { background: #f0f0f0; }
.cal-selected { background: #555; color: #fff; font-weight: bold; border-color: #555; }
.cal-today { border: 2px solid #555; }
.cal-weekend { background: #f5f5f5; }
.cal-empty { border: 1px solid #ddd; background: #f5f5f5; }

.selected-dates { margin: 15px 0; padding: 10px; background: #f9f9f9; border-radius: 4px; min-height: 20px; }
.selected-dates span { display: inline-block; background: #e8e8e8; border: 1px solid #d7d7d7; padding: 3px 8px; margin: 3px; border-radius: 3px; font-size: 12px; }
.selected-dates .remove { cursor: pointer; color: #dc3545; margin-left: 5px; font-weight: bold; }
.nav-links { margin-bottom: 15px; }
.nav-links a { color: #555; text-decoration: none; margin-right: 15px; }

/* ========== СКРОЛЛБАРЫ (как bpviz) ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ========== ПРЕВЬЮ-ТАБЛИЦА ========== */
table.preview { border-collapse: collapse; width: 100%; margin: 15px 0; }
table.preview th { background: #f9f9f9; color: #555; padding: 6px 10px; text-align: left; font-size: 13px; font-weight: 600; border-bottom: 2px solid #e7e7e7; }
table.preview td { border: 1px solid #e0e0e0; padding: 6px 10px; font-size: 13px; }

/* ========== ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ ========== */
.text-muted { color: #888; font-size: 12px; }
.text-center { text-align: center; }
.emoji-big { font-size: 48px; margin-bottom: 10px; }

/* ========== ИНФОРМАЦИОННАЯ ПАНЕЛЬ ========== */
.info-panel { text-align: left; font-size: 14px; color: #555; background: #f9f9f9; padding: 12px 15px; margin: 10px 0; border-radius: 4px; border-left: 4px solid #555; }

/* ========== КОММЕНТАРИИ ========== */
.comment { display: block; background-color: #f5f7fa; width: 100%; font-size: 12px; padding: 3px 5px; border-radius: 4px; border-left: 3px solid #90a4ae; }
.comment-full { display: block; background-color: #f5f7fa; width: 100%; font-size: 11px; padding: 4px 6px; border-radius: 4px; }

/* ========== ТЕКСТОВЫЕ СТИЛИ ========== */
.text-norm { color: #78909c; }
.text-fact { color: #d32f2f; font-weight: 500; }
.text-calc { color: #1976d2; font-weight: 500; }
.text-penalty { color: #388e3c; font-weight: 500; }
.text-info { font-size: 14px; color: #555; }

/* ========== ЯЧЕЙКИ СТАТУСОВ (stat.php — НЕ ТРОГАТЬ) ========== */
.cell-border { border: 1px solid #e1e8ed; background-color: #fafafa; }
.cell-v { border: 1px solid #fff3e0; background: linear-gradient(135deg, #fff3e0 0%, #fff8e1 100%); color: #e65100; }
.cell-otpusk { border: 1px solid #fce4ec; background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%); color: #880e4f; }
.cell-boleet { border: 1px solid #e3f2fd; background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e9 100%); color: #01579b; }
.cell-n { border: 1px solid #ffebee; background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%); color: #b71c1c; font-weight: 500; }
.cell-ud { border: 2px solid #e0f2f1; background: linear-gradient(135deg, #e0f2f1 0%, #e8f5e9 100%); color: #004d40; }
.cell-allok { border: 1px solid #e8f5e9; background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%); color: #1b5e20; }
.cell-weekend { background: linear-gradient(135deg, rgba(200,200,200,0.5) 0%, #e0e0e0 100%) !important; color: #888 !important; font-weight: 500; }
.cell-approved { box-shadow: inset 0 0 0 2px #9c27b0; }

/* ========== ИТОГИ ========== */
.penalty-total { border: 2px solid #FA6F6FA5; padding: 3px 8px; border-radius: 6px; background-color: #ffebee; color: #c62828; font-weight: 600; }
.overtime-total { border: 2px solid #a5d6a7; padding: 3px 8px; border-radius: 6px; background-color: #e8f5e9; color: #2e7d32; font-weight: 600; }
.total-sum { border: 2px solid #b0bec5; padding: 3px 8px; border-radius: 6px; background-color: #f5f7fa; color: #37474f; font-weight: 600; }

/* ========== ТАБЛИЦА С ФИКСИРОВАННЫМИ СТОЛБЦАМИ (stat.php) ========== */
.table-scroll-wrapper { height: calc(100vh - 180px); min-height: 300px; overflow: auto; position: relative; margin-top: 10px; border: 1px solid #d7d7d7; background: white; border-radius: 4px; }
#table { width: 100%; border-collapse: collapse; min-width: 100%; font-size: 12px; margin: 0; padding: 0; }
#table th:first-child, #table td:first-child { position: sticky; left: 0; background: #fff; z-index: 30; width: 50px !important; min-width: 50px !important; max-width: 50px !important; }
#table th:nth-child(2), #table td:nth-child(2) { position: sticky; left: 50px; background: #fff; z-index: 30; width: 250px !important; min-width: 250px !important; max-width: 250px !important; }
#table thead th { position: sticky; top: 0; z-index: 20; background: #2e7d32; color: #fff; padding: 6px 10px; font-weight: 600; font-size: 12px; white-space: nowrap; border: 1px solid #1b5e20; }
#table thead th:first-child { z-index: 41; background: #2e7d32; }
#table thead th:nth-child(2) { z-index: 41; background: #2e7d32; }
#table td { padding: 4px 6px; border: 1px solid #ddd; vertical-align: top; min-height: 35px; font-size: 12px; }
#table tbody tr:nth-child(even) { background: #fafafa; }
#table tbody tr:nth-child(odd) { background: #fff; }
#table tbody tr:hover { background: #f0f0f0; }
#table th { text-transform: none; font-size: 11px; letter-spacing: 0; }

/* ========== КАЛЕНДАРНАЯ ФОРМА ========== */
.calendar { border: 1px solid #d7d7d7; border-radius: 4px; color: #333; font-family: inherit; font-size: 14px; margin: 5px auto; padding: 5px; width: 320px; text-align: left; background: #fff; }

/* ========== Telegram иконки ========== */
img[src*="Tg_"] { border-radius: 4px; transition: transform 0.2s ease; }
img[src*="Tg_"]:hover { transform: scale(1.1); }

/* ========== КАЛЕНДАРЬ МИНИ (admin.php) ========== */
.calendar-mini { display: inline-block; background: #fff; border: 1px solid #d7d7d7; border-radius: 4px; padding: 10px; margin-bottom: 15px; }
.calendar-mini table { border-collapse: collapse; }
.calendar-mini th { background: none !important; color: #888 !important; font-size: 11px; padding: 2px !important; text-align: center; border: none !important; width: 32px; font-weight: 600; }
.calendar-mini td { text-align: center; padding: 0 !important; border: none !important; }
.calendar-mini td a { display: block; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; text-decoration: none; color: #333; font-size: 11px; margin: 1px auto; }
.calendar-mini td a:hover { background: #f0f0f0; }
.calendar-mini td a.today { border: 2px solid #555; font-weight: 700; line-height: 24px; }
.calendar-mini td a.selected { background: #2e7d32; color: #fff; }
.calendar-mini td a.filled::after { content: ''; display: block; width: 3px; height: 3px; background: #555; border-radius: 50%; margin: -4px auto 0; }
.calendar-mini td a.incomplete::after { content: ''; display: block; width: 5px; height: 5px; background: #d32f2f; border-radius: 50%; margin: -4px auto 0; }
.calendar-mini td a.selected.filled::after { background: #fff; }
.calendar-mini td a.today { border-color: #2e7d32; }
.calendar-mini .cm-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.calendar-mini .cm-nav .cm-title { font-size: 14px; font-weight: 600; }
.calendar-mini .cm-nav a { font-size: 18px; text-decoration: none; color: #555; padding: 2px 8px; border-radius: 4px; }
.calendar-mini .cm-nav a:hover { background: #eee; }

/* ========== ADMIN TOOLBAR ========== */
.admin-toolbar { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.admin-toolbar h2 { margin: 0; font-size: 18px; color: #333; }

/* ========== STAT TABLE WRAPPER (stat.php) ========== */
.stat-table-wrapper { height: 75vh; overflow: auto; border: 1px solid #d7d7d7; border-radius: 4px; background: #fff; }
.stat-table-wrapper table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stat-table-wrapper th { position: sticky; top: 0; z-index: 20; background: #2e7d32; color: #fff; padding: 6px 8px; font-size: 11px; white-space: nowrap; }
.stat-table-wrapper th:first-child, .stat-table-wrapper th:nth-child(2) { position: sticky; left: 0; z-index: 40; background: #2e7d32; }
.stat-table-wrapper th:first-child { left: 0; z-index: 41; }
.stat-table-wrapper th:nth-child(2) { left: 50px; z-index: 41; }
.stat-table-wrapper td { border: 1px solid #e0e0e0; padding: 4px 6px; vertical-align: top; min-width: 100px; }
.stat-table-wrapper td:first-child, .stat-table-wrapper td:nth-child(2) { position: sticky; left: 0; z-index: 10; background: #fff; border-right: 2px solid #ddd; }
.stat-table-wrapper td:nth-child(2) { left: 50px; }
.stat-table-wrapper tbody tr:nth-child(even) { background: #fafafa; }
.stat-table-wrapper tbody tr:hover { background: #f0f0f0; }

/* ============================================
   НАСЛЕДИЕ — классы из старого css.css
   ============================================ */
.table_col { font-family: inherit; font-size: 12px; width: 100%; background: white; text-align: left; border-collapse: collapse; color: #333; }
.table_col th { font-weight: 600; border-bottom: 2px solid #e7e7e7; background: #f9f9f9; color: #555; padding: 5px 8px; font-size: 11px; }
.table_col td { border: 1px solid #e0e0e0; padding: 4px 6px; font-size: 12px; color: #333; vertical-align: top; }
.table_col tbody tr:nth-child(even) { background: #fafafa; }
.table_col tbody tr:hover { background: #f0f0f0; }

/* scroll-table (для admin_old) */
.scroll-table { width: auto; }
.scroll-table-body { height: 650px; overflow-x: auto; margin-top: 0; margin-bottom: 20px; border: 1px solid #ddd; border-radius: 4px; }
