body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0d1117;
    color: #e6edf3;
    margin: 0;
    padding: 20px;
    font-size: 15px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

a { color: #58a6ff; text-decoration: none; }
a:hover { color: #79c0ff; text-decoration: underline; }

h1, h2, h3 { color: #58a6ff; margin-top: 0; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; margin-top: 24px; }

header {
    background: #161b22;
    border-bottom: 2px solid #1f6feb;
    color: #e6edf3;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -20px -20px 20px -20px;
    flex-wrap: wrap;
    gap: 10px;
}
header a { color: #e6edf3; font-weight: bold; }
header a:hover { color: #58a6ff; }

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
nav a {
    flex: 1 1 auto;
    min-width: 130px;
    padding: 14px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    text-decoration: none;
    color: #e6edf3;
    border-radius: 8px;
    text-align: center;
    transition: 0.2s;
    font-size: 14px;
    font-weight: 500;
}
nav a:hover, nav a:active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #fff;
    text-decoration: none;
}

input, select, textarea {
    background: #161b22;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 11px 12px;
    margin: 4px 0;
    font-size: 15px;
    font-family: inherit;
    width: 100%;
    max-width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31,111,235,0.25);
}
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; }
input[type=file] { padding: 8px; }

label {
    display: block;
    color: #8b949e;
    font-size: 13px;
    margin: 10px 0 4px 0;
}

button, input[type=submit] {
    background: #1f6feb;
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    transition: 0.2s;
    min-height: 44px;
    touch-action: manipulation;
}
button:hover, input[type=submit]:hover { background: #388bfd; }
button:active { transform: scale(0.98); }
button.danger { background: #da3633; }
button.danger:hover { background: #f85149; }
button.success { background: #238636; }
button.success:hover { background: #2ea043; }

.card, .box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #161b22;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #30363d;
    font-size: 14px;
    min-width: 600px;
}
th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #30363d;
    text-align: left;
    color: #e6edf3;
    white-space: nowrap;
}
th {
    background: #1f6feb;
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}
tr:hover td { background: #1c2230; }

.err { color: #f85149; font-weight: bold; }
.ok  { color: #3fb950; font-weight: bold; }

.stats-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 15px 0; }
.stat-card {
    flex: 1 1 160px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px 15px;
    text-align: center;
    min-width: 0;
}
.stat-card .label {
    color: #8b949e;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stat-card .value {
    color: #58a6ff;
    font-size: 20px;
    font-weight: bold;
    margin-top: 4px;
    word-break: break-word;
}
.stat-card.green .value { color: #3fb950; }
.stat-card.red   .value { color: #f85149; }
.stat-card.warn  .value { color: #d29922; }

.filter-bar, .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 15px 0;
}
.filter-bar label, .filters label {
    color: #8b949e;
    font-size: 13px;
    margin-right: 2px;
    display: inline-block;
}
.filter-bar input[type=text],
.filter-bar input[type=date],
.filters input[type=date],
.filters input[type=text] {
    width: auto;
    min-width: 140px;
    flex: 1 1 140px;
}

.wrap, .two-col { display: flex; gap: 20px; flex-wrap: wrap; }
.wrap .left, .two-col .main { flex: 2; min-width: 300px; }
.wrap .right, .two-col .side { flex: 1; min-width: 260px; }

@media (max-width: 700px) {
    body { padding: 12px; font-size: 14px; }
    header { padding: 10px 12px; margin: -12px -12px 15px -12px; font-size: 14px; }
    h1 { font-size: 20px; }
    h2 { font-size: 17px; }
    h3 { font-size: 15px; margin-top: 18px; }
    nav a { flex: 1 1 45%; min-width: 0; padding: 12px 10px; font-size: 13px; }
    .card, .box { padding: 14px; }
    .toolbar input, .toolbar select, .toolbar button,
    .filter-bar input, .filter-bar select, .filter-bar button,
    .filters input, .filters button {
        width: 100% !important; flex: 1 1 100%; min-width: 0; margin: 4px 0;
    }
    .stats-row { gap: 8px; }
    .stat-card { flex: 1 1 calc(50% - 8px); padding: 10px; }
    .stat-card .value { font-size: 17px; }
    .wrap .left, .wrap .right,
    .two-col .main, .two-col .side { flex: 1 1 100%; min-width: 0; }
    table { min-width: 520px; font-size: 13px; }
    th, td { padding: 8px 10px; }
    table form { display: block; margin-bottom: 4px; }
    table button { width: 100%; padding: 8px; font-size: 13px; }
    table input[type=text] { width: 100% !important; }
    .actions, .action-group { display: block; }
    .actions > *, .action-group > * { width: 100%; margin: 4px 0; }
    .box { width: 100% !important; max-width: 100%; }
}
@media (max-width: 400px) {
    nav a { flex: 1 1 100%; }
    .stat-card { flex: 1 1 100%; }
}
@media (hover: none) and (pointer: coarse) {
    button, a.btn, input[type=submit], nav a { min-height: 46px; font-size: 15px; }
    input, select { min-height: 44px; font-size: 16px; }
    table th { position: static; }
}
@supports (-webkit-touch-callout: none) {
    input, select, textarea { font-size: 16px; }
}
