body { font-family: Arial, sans-serif; margin: 24px; background: #f7f8fb; color: #1e1e1e; box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
.page { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.top-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.top-bar-left { display: flex; align-items: center; gap: 8px; }
.top-bar-right { display: flex; align-items: center; }
.main-menu { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.main-menu .button { padding: 10px 14px; }
.logout-button { padding: 8px 12px; font-size: 0.9rem; }
.button { display: inline-flex; align-items: center; justify-content: center; background: #1f4b78; color: #fff; border-radius: 10px; padding: 10px 16px; text-decoration: none; border: 1px solid transparent; transition: background 0.2s ease; cursor: pointer; }
.button:hover { background: #173b61; }
.box { background: #fff; border: 1px solid #d9dee9; padding: 18px; border-radius: 12px; margin-bottom: 18px; }
.error { color: #d33; margin-bottom: 12px; }
.success { color: #155724; background: #d4edda; border: 1px solid #c3e6cb; padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; }
.notice { padding: 14px; border-radius: 10px; margin-bottom: 18px; background: #eef7ff; border: 1px solid #c6ddff; }
.notice strong { display: block; margin-bottom: 8px; }
.search-bar, .search-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-input, .search-row input[type="text"], .search-row input[type="email"], .search-row input[type="url"] { flex: 1 1 220px; min-width: 180px; border: 1px solid #ccd3db; border-radius: 10px; padding: 12px 14px; font-size: 1rem; }
.form-row { margin-bottom: 16px; }
label { display: block; margin-bottom: 8px; }
input[type="text"], input[type="email"], input[type="url"], textarea, input[type="file"], select { width: 100%; padding: 10px 12px; border: 1px solid #ccd3db; border-radius: 8px; font-size: 1rem; }
textarea { min-height: 180px; resize: vertical; font-family: inherit; }
.card form { display: flex; flex-direction: column; gap: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar button { background: #eef4ff; color: #1f4b78; border: 1px solid #d0e0ff; border-radius: 8px; padding: 8px 12px; cursor: pointer; transition: background 0.2s ease; }
.toolbar button:hover { background: #d8e6ff; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #d9dee9; padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: #eef4ff; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-heading h1, .page-heading h2 { margin: 0; font-size: 1.5rem; }
.page-heading .hint { margin-top: 4px; }
.page-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-tab { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; text-decoration: none; color: #1f4b78; background: #eef4ff; transition: background 0.2s ease, border-color 0.2s ease; }
.page-tab.active { background: #1f4b78; color: #fff; border-color: #1f4b78; }
.page-tab:hover { background: #d8e6ff; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.action-buttons form { display: inline-block; margin: 0; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination a { text-decoration: none; color: #1f4b78; border: 1px solid #ccd3db; border-radius: 8px; padding: 8px 12px; background: #eef4ff; transition: background 0.2s ease; }
.pagination a.active { background: #1f4b78; color: #fff; border-color: #1f4b78; }
.pagination a:hover { background: #d8e6ff; }
.client-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.client-chip { display: inline-block; background: #eef4ff; border: 1px solid #d0e0ff; color: #1f4b78; border-radius: 999px; padding: 8px 12px; text-decoration: none; font-size: 0.95rem; }
.client-chip:hover { background: #d8e6ff; }
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid #d9dee9; border-radius: 10px; padding: 18px 22px; min-width: 140px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.card strong { display: block; margin-bottom: 8px; color: #333; }
.card div { font-size: 1.6rem; font-weight: bold; }
.new-ticket-card { max-width: 820px; margin: 0 auto 18px; }
.new-ticket-card .form-row { max-width: 100%; }
.new-ticket-card label { font-weight: 600; margin-bottom: 8px; }
.new-ticket-card .hint { font-size: 0.95rem; color: #5d6d7b; margin-top: 8px; }
.new-ticket-card input[type="file"] { padding: 12px 10px; }
.form-actions { display: flex; justify-content: flex-end; }
.form-actions .button { min-width: 180px; }
.client-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.client-card { background: #fff; border: 1px solid #d9dee9; border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.client-card-info { flex: 1 1 auto; }
.client-card-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.client-card a { color: #1f4b78; text-decoration: none; }
.client-card-actions .button { min-width: 120px; white-space: nowrap; }
.button.primary { background: #2563eb; }
.button.primary:hover { background: #1e56c2; }
.button.secondary { background: #38a169; }
.button.secondary:hover { background: #2f8b58; }
.summary { margin-bottom: 18px; }
.client-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; }
.client-summary .summary-title { font-size: 1.05rem; font-weight: 700; color: #1f4b78; margin-bottom: 6px; }
.client-summary p { margin: 0; color: #4b5563; max-width: 680px; }
.client-summary .summary-value { min-width: 96px; text-align: center; }
.client-summary .summary-value div:first-child { font-size: 2rem; font-weight: 700; color: #173b61; }
.client-summary .summary-unit { font-size: 0.92rem; color: #5d6d7b; letter-spacing: 0.04em; margin-top: 4px; }
.small-button { padding: 8px 12px; border-radius: 8px; border: none; cursor: pointer; }
.small-button.save { background: #1f4b78; color: #fff; }
.small-button.delete { background: #c33; color: #fff; }
.table-wrap { overflow-x: auto; }
.thread { margin-top: 24px; }
.thread-message { border-radius: 12px; margin-bottom: 14px; padding: 16px; position: relative; max-width: 760px; }
.thread-message .meta { font-size: 0.95em; margin-bottom: 10px; color: #4a4a4a; }
.thread-message.customer { background: #ffffff; border: 1px solid #d8dbe1; margin-left: 0; }
.thread-message.support { background: #eef7ff; border: 1px solid #c6ddff; margin-left: 40px; }
.thread-message.support .meta { color: #1f4b78; }
.thread-message.customer .meta { color: #333; }
.thread-message .body { white-space: pre-wrap; line-height: 1.6; }
.reply-box textarea { width: 100%; border: 1px solid #c2c8d1; border-radius: 8px; padding: 12px; font-family: inherit; font-size: 1rem; }

.ticket {
    background: #fff;
    border: 1px solid #d9dee9;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 18px 40px rgba(15, 35, 60, 0.08);
}

.ticket h2 {
    margin: 0 0 10px;
    font-size: 1.8rem;
    line-height: 1.2;
}

.ticket .meta {
    margin-bottom: 8px;
    color: #4b5563;
    font-size: 0.95rem;
}

.ticket-description {
    color: #2b2f36;
    line-height: 1.75;
    margin: 18px 0;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 18px;
}

.ticket-header-left {
    flex: 1 1 auto;
}

.ticket-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.ticket-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 0.95rem;
}

.ticket-meta-row a {
    color: #1f4b78;
    text-decoration: none;
}

.ticket-header-right {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.ticket-header-form,
.ticket-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ticket-header-form select {
    min-width: 140px;
    border-radius: 8px;
    padding: 8px 10px;
}

.button.small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.reply-box textarea {
    width: 100%;
    min-height: 220px;
    border: 1px solid #c2c8d1;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
    background: #ffffff;
}

.ticket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.ticket-action-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ticket-action-form select {
    min-width: 180px;
}

.ticket .button-danger {
    border-radius: 12px;
    padding: 10px 16px;
}
.ticket-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.ticket-header-actions select {
    min-width: 130px;
    border-radius: 8px;
    padding: 8px 10px;
    border: 1px solid #c2c8d1;
}
.ticket-header-actions .button.small {
    padding: 8px 12px;
    font-size: 0.9rem;
}
.reply-box .toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.reply-box .toolbar button { background: #eef4ff; color: #1f4b78; border: 1px solid #d0e0ff; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.reply-box .toolbar button:hover { background: #d8e6ff; }
.reply-box button { background: #1f4b78; color: #fff; border: none; border-radius: 8px; padding: 10px 18px; cursor: pointer; }
.reply-box textarea { display: block; width: 100%; min-height: 220px; border: 1px solid #c2c8d1; border-radius: 8px; padding: 12px; font-family: inherit; font-size: 1rem; background: #f8fafc; }
.reply-box button:hover { background: #173b61; }
.reply-footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.reply-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-form select { padding: 8px 10px; border-radius: 6px; border: 1px solid #c2c8d1; }
.status-form button { margin-left: 10px; background: #1f4b78; color: #fff; border: none; border-radius: 8px; padding: 10px 18px; cursor: pointer; }
.status-form button:hover { background: #173b61; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-weight: 600; }
.message { margin-bottom: 16px; padding: 14px 16px; border-radius: 10px; background: #f5f5f5; border: 1px solid #dde2e8; color: #1f2a37; }
.message.error { background: #fff1f1; border-color: #f3c6c6; color: #8a1f1f; }
.message.success { background: #eaf7ed; border-color: #c3e6cb; color: #155724; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding-top: 40px; padding-bottom: 40px; }
.login-box { width: 100%; max-width: 440px; box-shadow: 0 15px 40px rgba(19, 43, 71, 0.08); }
.hint { font-size: 0.95rem; color: #555; margin-bottom: 16px; }
.button-danger { background: #dc2626; }
.button-danger:hover { background: #b91c1c; }
.button-warning { background: #f59e0b; color: #fff; }
.button-warning:hover { background: #d97706; }
.button-success { background: #16a34a; }
.button-success:hover { background: #15803d; }
.button-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; font-size: 1.1rem; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 1000; }
.modal-content { background: #fff; border-radius: 16px; max-width: 850px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.18); position: relative; }
.modal-close { position: absolute; top: 16px; right: 16px; background: transparent; border: none; font-size: 1.6rem; color: #333; cursor: pointer; }
.modal-close:hover { color: #000; }
.modal h2 { margin-top: 0; }
.small-table th, .small-table td { padding: 8px 10px; }
.update-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #fff4d9; border: 1px solid #f1c40f; color: #5a4c19; margin-bottom: 18px; }
.update-banner .button { margin-left: auto; }
.ticket-detail { border: 1px solid #d8dde6; padding: 30px; border-radius: 18px; background: #fff; box-shadow: 0 18px 40px rgba(15, 35, 60, 0.08); max-width: 980px; margin: 0 auto 24px; }
.ticket-detail h2 { margin-top: 0; margin-bottom: 16px; font-size: 1.75rem; }
.ticket-detail .meta { color: #4b5563; margin-bottom: 10px; font-size: 0.95rem; }
.ticket-detail .meta + .meta { margin-top: -4px; }
.ticket-detail .status { display: inline-block; margin-left: 12px; padding: 4px 12px; background: #e7f0ff; color: #1f4b78; border-radius: 999px; font-size: 0.92rem; font-weight: 600; }
.ticket-detail p { margin: 0; color: #2c2f34; line-height: 1.8; }
.ticket-detail strong { color: #1f2937; }

.reply-box { background: #fff; border: 1px solid #d8dde6; border-radius: 18px; padding: 24px; box-shadow: 0 18px 40px rgba(15, 35, 60, 0.08); max-width: 980px; margin: 0 auto 24px; }
.reply-box textarea { min-height: 220px; }
.reply-box .toolbar { margin-bottom: 16px; }
.reply-box .toolbar button { min-width: 80px; }

.reply-footer-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.reply-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.reply-actions .button { white-space: nowrap; }

.status-form { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-form select { width: 320px; }
.status-form button { margin-left: 0; }
