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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f6f8fa;
    color: #24292f;
    line-height: 1.5;
}

/* -------- Login page -------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    padding: 20px;
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 380px;
}
.login-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #0369a1;
}
.login-box .subtitle {
    color: #656d76;
    margin-bottom: 24px;
    font-size: 14px;
}
.login-box input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 12px;
}
.login-box input:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.15);
}
.login-box button {
    width: 100%;
    padding: 12px;
    background: #0369a1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.login-box button:hover { background: #075985; }

.error, .error-banner {
    background: #ffebe9;
    color: #cf222e;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid #ffcecb;
}

/* -------- Header -------- */
header {
    background: white;
    border-bottom: 1px solid #d0d7de;
    padding: 16px 0;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
header h1 {
    font-size: 20px;
    color: #0369a1;
    font-weight: 600;
}
.header-meta {
    font-size: 13px;
    color: #656d76;
    display: flex;
    gap: 20px;
    align-items: center;
}
.logout {
    color: #0969da;
    text-decoration: none;
}
.logout:hover { text-decoration: underline; }

/* -------- Main -------- */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* -------- Stats -------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: border-color 0.15s, transform 0.15s;
}
.stat:hover {
    border-color: #0969da;
    transform: translateY(-1px);
}
.stat-num {
    font-size: 32px;
    font-weight: 600;
    color: #0369a1;
    line-height: 1;
}
.stat-label {
    font-size: 12px;
    color: #656d76;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

/* -------- Filters -------- */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filters input, .filters select {
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #24292f;
}
.filters input:focus, .filters select:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.15);
}
.filters input[type="search"] {
    flex: 1;
    min-width: 220px;
}
.filters button {
    padding: 8px 16px;
    background: #0369a1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.filters button:hover { background: #075985; }
.filters .reset {
    padding: 8px 16px;
    color: #656d76;
    text-decoration: none;
    font-size: 14px;
}
.filters .reset:hover { color: #24292f; }

/* -------- Table -------- */
.table-wrap {
    background: white;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    overflow: hidden;
    overflow-x: auto;
}
table.tickets {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
table.tickets th {
    text-align: left;
    padding: 12px 16px;
    background: #f6f8fa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #656d76;
    border-bottom: 1px solid #d0d7de;
    font-weight: 600;
    white-space: nowrap;
}
table.tickets td {
    padding: 12px 16px;
    border-bottom: 1px solid #eaeef2;
    font-size: 14px;
    vertical-align: middle;
}
table.tickets tr:last-child td { border-bottom: none; }
table.tickets tbody tr:hover { background: #f6f8fa; }
.tnum {
    color: #656d76;
    font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;
    font-size: 13px;
    white-space: nowrap;
}
.subject {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.date {
    color: #656d76;
    white-space: nowrap;
    font-size: 13px;
}
.empty {
    text-align: center;
    color: #656d76;
    padding: 40px !important;
}

/* -------- Badges -------- */
.status, .classify {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.status-open      { background: #dafbe1; color: #116329; }
.status-on-hold   { background: #fff8c5; color: #7d4e00; }
.status-escalated { background: #ffebe9; color: #cf222e; }
.status-closed    { background: #eaeef2; color: #656d76; }

.classify-feature-request { background: #ddf4ff; color: #0969da; }
.classify-question        { background: #fbefff; color: #8250df; }
.classify-problem         { background: #ffebe9; color: #cf222e; }
.classify-other           { background: #eaeef2; color: #656d76; }
.classify-none            { background: #eaeef2; color: #656d76; }

/* -------- Footer -------- */
.footer {
    margin-top: 20px;
    text-align: center;
    color: #656d76;
    font-size: 13px;
}

/* -------- Small screens -------- */
@media (max-width: 700px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .header-inner { flex-direction: column; align-items: flex-start; }
    main { padding: 16px; }
    .subject { max-width: 200px; }
}
