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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0f1117;
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 18px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    background: linear-gradient(135deg, rgba(26,29,46,0.97) 0%, rgba(45,31,61,0.97) 100%);
    padding: 1.25rem 2rem;
    border-bottom: 3px solid rgba(108,92,231,0.6);
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.5px;
}
.logo span { color: #a29bfe; }
nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
nav a {
    color: #c0bedd;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
nav a:hover {
    color: #fff;
    border-bottom-color: #a29bfe;
}

/* ── Layout ── */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    color: #fff;
}
h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

/* ── Alerts ── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}
.alert-error {
    background: rgba(214, 48, 49, 0.2);
    color: #ff7675;
    border: 1px solid #d63031;
}
.alert-success {
    background: rgba(0, 184, 148, 0.2);
    color: #55efc4;
    border: 1px solid #00b894;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    background: #6c5ce7;
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}
.btn:hover { background: #5a4bd1; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-secondary {
    background: #2c2f45;
    margin-left: 0.5rem;
}
.btn-secondary:hover { background: #3a3e5c; }
.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* ── Standard forms (non-wizard) ── */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    background: #12141f;
    border: 2px solid #2a2d42;
    color: #e0e0e0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

/* ── Lookup form ── */
.lookup-form {
    background: #1a1d2e;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #2a2d42;
}
.lookup-form h2 {
    margin-bottom: 1.25rem;
    font-size: 1.3rem;
    color: #ddd;
}
.lookup-form .form-group {
    margin-bottom: 1.25rem;
}
.lookup-form .form-group label {
    font-size: 0.95rem;
    color: #aaa;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.lookup-form .btn {
    margin-top: 0.5rem;
    width: 100%;
    max-width: 280px;
    text-align: center;
}

/* ── Ticket tables ── */
.ticket-count, .no-tickets {
    margin-bottom: 1.25rem;
    color: #aaa;
    font-size: 1rem;
}
.no-tickets {
    background: #1a1d2e;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    color: #888;
}
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.ticket-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1d2e;
    border-radius: 10px;
    overflow: hidden;
}
.ticket-table th,
.ticket-table td {
    padding: 0.85rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #1f2233;
    font-size: 0.95rem;
}
.ticket-table th {
    background: #12141f;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888;
}
.ticket-table tr:hover td { background: #1f2233; }

/* ── Status badges ── */
.status {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}
.status-open { background: rgba(108, 92, 231, 0.3); color: #a29bfe; }
.status-in_progress { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.status-resolved { background: rgba(0, 184, 148, 0.2); color: #55efc4; }
.status-closed { background: rgba(128, 128, 128, 0.3); color: #aaa; }

/* ── Ticket detail ── */
.ticket-detail-card {
    background: #1a1d2e;
    border-radius: 12px;
    border: 1px solid #2a2d42;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.ticket-detail-card .detail-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #2a2d42;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.ticket-detail-card .detail-header h2 {
    margin: 0;
    font-size: 1.4rem;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
}
.detail-field {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1f2233;
}
.detail-field:last-child { border-bottom: none; }
.detail-field.full-width {
    grid-column: 1 / -1;
}
.detail-field dt {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #777;
    margin-bottom: 0.35rem;
    font-weight: 600;
}
.detail-field dd {
    font-size: 1rem;
    color: #e0e0e0;
    margin: 0;
}
.detail-field dd.description {
    white-space: pre-wrap;
    line-height: 1.7;
    color: #ccc;
}

/* ── Tips ── */
.tips-content {
    background: #1a1d2e;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #2a2d42;
    line-height: 1.7;
}
.tips-content h1, .tips-content h2, .tips-content h3 { margin: 1.25rem 0 0.6rem; color: #fff; }
.tips-content h1:first-child { margin-top: 0; }
.tips-content p { margin-bottom: 0.85rem; font-size: 1rem; }
.tips-content ul, .tips-content ol { margin: 0.5rem 0 1.25rem 1.75rem; }
.tips-content li { margin-bottom: 0.4rem; }
.tips-content a { color: #a29bfe; }
.tips-content code { background: #12141f; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.9em; }

/* ── Admin ── */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.admin-topbar h1 { margin-bottom: 0; }
.admin-topbar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn-logout {
    background: #2c2f45;
    border: 1px solid #444;
    color: #ccc;
}
.btn-logout:hover {
    background: #d63031;
    border-color: #d63031;
    color: #fff;
}
.admin-page .container {
    max-width: 1600px;
}
.admin-table .desc-cell {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-ticket-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.admin-ticket-form select { width: auto; max-width: 140px; }
.admin-ticket-form input[type="text"] { flex: 1; min-width: 140px; max-width: 260px; }
.markdown-editor {
    max-width: 100%;
    min-height: 400px;
    font-family: ui-monospace, monospace;
    font-size: 0.95rem;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 1.5rem;
    color: #555;
    font-size: 0.9rem;
    border-top: 1px solid #1f2233;
}


/* ════════════════════════════════════════
   WIZARD (Multi-step Submit Form)
   ════════════════════════════════════════ */

.wizard-container {
    max-width: 660px;
    margin: 0 auto;
}

/* Progress bar */
.wizard-progress-wrap {
    background: #1a1d2e;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.wizard-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Step indicator text */
.wizard-step-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2.5rem;
    font-weight: 600;
}

/* Each step panel */
.wizard-step {
    display: none;
    animation: fadeSlideIn 0.3s ease;
}
.wizard-step.active {
    display: block;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* The big question */
.wizard-question {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
    line-height: 1.25;
}

/* Sub-hint text */
.wizard-hint {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Input wrapper */
.wizard-input-wrap {
    margin-bottom: 1.5rem;
}

/* Big wizard inputs */
.wizard-input {
    display: block;
    width: 100%;
    background: #12141f;
    border: 2px solid #2a2d42;
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 1.4rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wizard-input:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
}
.wizard-input::placeholder {
    color: #555;
}

/* Big wizard select */
.wizard-select {
    display: block;
    width: 100%;
    background: #12141f;
    border: 2px solid #2a2d42;
    color: #e0e0e0;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 1.25rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
}
.wizard-select:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
}

/* Big wizard date input */
.wizard-input[type="date"] {
    font-size: 1.3rem;
    color-scheme: dark;
}

/* Big wizard textarea */
.wizard-textarea {
    display: block;
    width: 100%;
    background: #12141f;
    border: 2px solid #2a2d42;
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 1.15rem;
    font-family: inherit;
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wizard-textarea:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
}
.wizard-textarea::placeholder {
    color: #555;
}

/* Inline validation error */
.wizard-field-error {
    color: #ff7675;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

/* Type selection cards */
.type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.type-card {
    background: #1a1d2e;
    border: 2px solid #2a2d42;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    user-select: none;
}
.type-card:hover {
    border-color: #6c5ce7;
    background: #1f2240;
    transform: translateY(-2px);
}
.type-card.selected {
    border-color: #a29bfe;
    background: rgba(108, 92, 231, 0.18);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
}
.type-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
}
.type-card.selected .type-card-title {
    color: #a29bfe;
}
.type-card-desc {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.4;
}

/* Wizard navigation buttons */
.wizard-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #1f2233;
}
.btn-wizard-next,
.btn-wizard-submit {
    background: #6c5ce7;
    color: #fff;
    border: none;
    padding: 0.9rem 2.5rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}
.btn-wizard-next:hover,
.btn-wizard-submit:hover {
    background: #5a4bd1;
    transform: translateY(-1px);
}
.btn-wizard-next:disabled {
    background: #3a3a5c;
    color: #666;
    cursor: not-allowed;
    transform: none;
}
.btn-wizard-back {
    background: transparent;
    color: #888;
    border: 2px solid #2a2d42;
    padding: 0.9rem 1.75rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.btn-wizard-back:hover {
    border-color: #6c5ce7;
    color: #a29bfe;
}
.btn-wizard-submit {
    background: #00b894;
}
.btn-wizard-submit:hover {
    background: #00a381;
}

/* Review step */
.wizard-review-card {
    background: #1a1d2e;
    border: 1px solid #2a2d42;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.review-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1f2233;
    align-items: flex-start;
}
.review-row:last-child { border-bottom: none; }
.review-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #777;
    font-weight: 700;
    min-width: 130px;
    padding-top: 0.2rem;
}
.review-value {
    font-size: 1rem;
    color: #e0e0e0;
    flex: 1;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Shake animation for validation errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
.wizard-step.shake {
    animation: shake 0.45s ease;
}

/* Ticket cards on lookup results */
.ticket-card {
    background: #1a1d2e;
    border: 1px solid #2a2d42;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    transition: border-color 0.15s;
}
.ticket-card:hover { border-color: #6c5ce7; }
.ticket-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.ticket-card-id {
    font-size: 0.85rem;
    color: #777;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ticket-card-type {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.ticket-card-date {
    font-size: 0.9rem;
    color: #888;
}
.ticket-card-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Ticket detail actions bar ── */
.ticket-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.5rem;
}
.btn-close-ticket {
    background: #d63031;
}
.btn-close-ticket:hover {
    background: #b52828;
}

/* ── Screenshot upload ── */
.screenshot-upload-wrap {
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid #1f2233;
}
.screenshot-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ddd;
    margin-bottom: 0.35rem;
}
.screenshot-optional {
    font-weight: 400;
    color: #777;
    font-size: 0.9rem;
}
.screenshot-hint {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}
.screenshot-dropzone {
    display: block;
    cursor: pointer;
    border: 2px dashed #2a2d42;
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    background: #12141f;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.screenshot-dropzone:hover,
.screenshot-dropzone.drag-over {
    border-color: #6c5ce7;
    background: #1a1d35;
}
.screenshot-dropzone.has-file {
    border-color: #00b894;
    border-style: solid;
}
.screenshot-dropzone-text {
    font-size: 1rem;
    color: #888;
    display: block;
    margin-bottom: 0.5rem;
}
.screenshot-dropzone.has-file .screenshot-dropzone-text {
    color: #55efc4;
    font-weight: 600;
}
.screenshot-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 0.75rem;
    object-fit: contain;
}

/* ── Attachment image (detail + admin) ── */
.attachment-wrap {
    margin-top: 0.75rem;
}
.attachment-img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 10px;
    border: 1px solid #2a2d42;
    cursor: pointer;
    transition: opacity 0.15s;
    display: block;
}
.attachment-img:hover { opacity: 0.88; }
.attachment-thumb {
    max-height: 72px;
    max-width: 120px;
    border-radius: 6px;
    border: 1px solid #2a2d42;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 600px) {
    header { padding: 1rem 1.25rem; }
    .logo { font-size: 1.3rem; }
    nav { gap: 1.25rem; }
    nav a { font-size: 0.95rem; }
    .container { padding: 1.5rem 1rem; }
    h1 { font-size: 1.6rem; }
    .wizard-question { font-size: 1.6rem; }
    .wizard-input { font-size: 1.2rem; }
    .wizard-select { font-size: 1.1rem; }
    .type-cards { grid-template-columns: 1fr; }
}
