/* =====================================================================
   TMS 요청관리 - 공통 스타일 (TMS 포팅 화면과 같은 톤: antd/Isomorphic 계열)
   ===================================================================== */
* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: "Malgun Gothic", "맑은 고딕", -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    font-size: 13px;
    color: rgba(0, 0, 0, .85);
    background: #f1f3f6;
}

a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }

/* ---------------------------------------------------------------- 레이아웃 */
.req-layout { display: flex; min-height: 100vh; }

.req-sider {
    width: 240px; flex: 0 0 240px;
    background: #001529; color: rgba(255, 255, 255, .65);
    display: flex; flex-direction: column;
}
.req-logo {
    height: 70px; display: flex; align-items: center; padding: 0 24px;
    color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .5px;
    background: rgba(255, 255, 255, .04);
}
.req-logo small { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,.45); }
.req-menu { padding: 12px 0; }
.req-menu a {
    display: flex; align-items: center; gap: 10px;
    height: 40px; padding: 0 24px; color: rgba(255, 255, 255, .65); font-size: 13px;
}
.req-menu a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.req-menu a.active { color: #fff; background: #1890ff; }
.req-menu .cat {
    padding: 14px 24px 6px; font-size: 11px; color: rgba(255, 255, 255, .35);
    text-transform: uppercase; letter-spacing: .6px;
}

.req-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.req-topbar {
    height: 70px; background: #fff; border-bottom: 1px solid #e9e9e9;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: relative; z-index: 20;
}
.req-topbar .title { font-size: 15px; font-weight: 600; }
.req-user { position: relative; }
.req-user button {
    display: flex; align-items: center; gap: 8px; background: none; border: 0;
    cursor: pointer; font-size: 13px; color: rgba(0, 0, 0, .75); padding: 6px 8px;
}
.req-user .avatar {
    width: 28px; height: 28px; border-radius: 50%; background: #1890ff; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.req-dropdown {
    display: none; position: absolute; right: 0; top: 46px; min-width: 190px;
    background: #fff; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    padding: 4px 0; z-index: 30;
}
.req-dropdown.open { display: block; }
.req-dropdown .name { padding: 8px 16px; border-bottom: 1px solid #f0f0f0; font-weight: 600; }
.req-dropdown .name small { display: block; font-weight: 400; color: rgba(0, 0, 0, .45); }
.req-dropdown a { display: block; padding: 8px 16px; color: rgba(0, 0, 0, .75); }
.req-dropdown a:hover { background: #e6f7ff; color: #1890ff; }

.req-content { padding: 20px 24px 40px; flex: 1; }

/* ---------------------------------------------------------------- 카드 */
.card {
    background: #fff; border: 1px solid #e4e6e9; border-radius: 10px;
    padding: 18px 20px; margin-bottom: 16px; position: relative;
}
.card > h3 {
    margin: 0 0 14px; font-size: 14px; font-weight: 600; color: rgba(0, 0, 0, .85);
    display: flex; align-items: center; justify-content: space-between;
}
.card.dev { border-color: #ffd591; background: #fffdf7; }
.card.dev > h3 { color: #d46b08; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.page-head .sub { color: rgba(0, 0, 0, .45); font-size: 12px; margin-left: 8px; font-weight: 400; }

/* ---------------------------------------------------------------- 버튼 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 30px; padding: 0 15px; border-radius: 4px; border: 1px solid #d9d9d9;
    background: #fff; color: rgba(0, 0, 0, .75); font-size: 13px; cursor: pointer;
    white-space: nowrap;
}
.btn:hover { border-color: #40a9ff; color: #40a9ff; }
.btn-primary { background: #1890ff; border-color: #1890ff; color: #fff; }
.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }
.btn-green { background: #52c41a; border-color: #52c41a; color: #fff; }
.btn-green:hover { background: #73d13d; border-color: #73d13d; color: #fff; }
.btn-danger { color: #ff4d4f; border-color: #ffa39e; }
.btn-danger:hover { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.btn-lg { height: 38px; padding: 0 22px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.toolbar { display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- 폼 */
.field { margin-bottom: 12px; }
.field > label {
    display: block; margin-bottom: 4px; font-size: 12px; color: rgba(0, 0, 0, .65);
}
.field > label .req { color: #ff4d4f; margin-left: 2px; }
.grid { display: grid; gap: 0 16px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.grid.c4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

input[type=text], input[type=password], input[type=email], input[type=date],
input[type=url], select, textarea {
    width: 100%; border: 1px solid #d9d9d9; border-radius: 4px;
    padding: 4px 10px; font-size: 13px; font-family: inherit; color: rgba(0, 0, 0, .85);
    background: #fff;
}
input[type=text], input[type=password], input[type=email], input[type=date],
input[type=url], select { height: 30px; }
textarea { min-height: 88px; padding: 6px 10px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #40a9ff; box-shadow: 0 0 0 2px rgba(24,144,255,.15); }
input:disabled, textarea:disabled, select:disabled { background: #f5f5f5; color: rgba(0, 0, 0, .45); }
.radio-row { display: flex; gap: 18px; align-items: center; height: 30px; }
.radio-row label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.hint { font-size: 11px; color: rgba(0, 0, 0, .4); margin-top: 3px; }

/* ---------------------------------------------------------------- 검색바 */
.searchbar {
    background: #fff; border: 1px solid #e4e6e9; border-radius: 10px;
    padding: 14px 16px 4px; margin-bottom: 14px;
}
.searchbar .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.searchbar .item { min-width: 130px; }
.searchbar .item.grow { flex: 1; min-width: 220px; }
.searchbar .item > label { display: block; font-size: 11px; color: rgba(0,0,0,.45); margin-bottom: 3px; }
.searchbar .actions { display: flex; gap: 8px; padding-bottom: 1px; }

/* ---------------------------------------------------------------- 테이블 */
.table-wrap { background: #fff; border: 1px solid #e4e6e9; border-radius: 10px; overflow: hidden; position: relative; }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
    background: #fafafa; text-align: left; font-weight: 600; font-size: 12px;
    color: rgba(0, 0, 0, .85); padding: 10px 12px; border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
table.list td {
    padding: 9px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top;
    font-size: 12.5px; line-height: 1.5;
}
table.list tbody tr:hover { background: #e6f7ff; }
table.list td.nowrap, table.list th.nowrap { white-space: nowrap; }
table.list td.center, table.list th.center { text-align: center; }
table.list .empty { text-align: center; color: rgba(0, 0, 0, .35); padding: 48px 0; }
table.list .ttl { font-weight: 600; }
table.list .memo { color: rgba(0, 0, 0, .65); max-width: 320px; }
.linkcell { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 뱃지 */
.badge {
    display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px;
    line-height: 18px; white-space: nowrap; border: 1px solid transparent;
}
.st-pending  { background: #fafafa; color: rgba(0,0,0,.55); border-color: #d9d9d9; }
.st-received { background: #e6f7ff; color: #1890ff; border-color: #91d5ff; }
.st-progress { background: #fff7e6; color: #fa8c16; border-color: #ffd591; }
.st-hold     { background: #f9f0ff; color: #722ed1; border-color: #d3adf7; }
.st-done     { background: #f6ffed; color: #52c41a; border-color: #b7eb8f; }
.st-reject   { background: #fff1f0; color: #ff4d4f; border-color: #ffa39e; }
.ug-high { color: #ff4d4f; font-weight: 700; }
.ug-mid  { color: #fa8c16; }
.ug-low  { color: rgba(0, 0, 0, .45); }

/* 페이저 */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pager .pages a, .pager .pages span {
    min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid #d9d9d9; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center; color: rgba(0, 0, 0, .75);
}
.pager .pages a:hover { border-color: #1890ff; color: #1890ff; }
.pager .pages .cur { border-color: #1890ff; color: #1890ff; font-weight: 600; }
.pager .pages .dots { border: 0; }
.pager .total { color: rgba(0, 0, 0, .45); }
.pager select { width: auto; display: inline-block; }

/* 로딩 */
.table-wrap.htmx-request::after {
    content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .6);
}
.table-wrap.htmx-request::before {
    content: "Data Loading..."; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); z-index: 2; color: #1890ff; font-size: 13px;
}

/* ---------------------------------------------------------------- 첨부 */
.dropzone {
    border: 1px dashed #d9d9d9; border-radius: 6px; background: #fafafa;
    padding: 22px; text-align: center; color: rgba(0, 0, 0, .55); cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: #1890ff; background: #f0f8ff; color: #1890ff; }
.dropzone b { color: #1890ff; }
.filelist { list-style: none; margin: 10px 0 0; padding: 0; }
.filelist li {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px;
    border-bottom: 1px dashed #f0f0f0; font-size: 12.5px;
}
.filelist li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist li .size { color: rgba(0, 0, 0, .4); font-size: 11px; }
.filelist li .rm {
    border: 0; background: none; color: rgba(0, 0, 0, .35); cursor: pointer; font-size: 14px;
}
.filelist li .rm:hover { color: #ff4d4f; }
.filelist li.new { background: #f6ffed; }
.filelist li.removed { opacity: .45; text-decoration: line-through; }

/* ---------------------------------------------------------------- 로그인 */
.login-wrap {
    min-height: 100vh; display: flex; justify-content: flex-end;
    background: linear-gradient(135deg, #0b2545 0%, #13315c 45%, #1890ff 140%);
}
.login-card {
    width: 500px; background: #fff; padding: 60px 56px;
    display: flex; flex-direction: column; justify-content: center;
}
.login-card h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; }
.login-card .desc { color: rgba(0, 0, 0, .45); margin-bottom: 34px; font-size: 13px; }
.login-card input { height: 42px; font-size: 14px; margin-bottom: 14px; }
.login-card .btn { width: 100%; height: 44px; font-size: 15px; }
.login-foot { margin-top: 28px; font-size: 11.5px; color: rgba(0, 0, 0, .35); line-height: 1.7; }
@media (max-width: 900px) {
    .login-wrap { justify-content: center; }
    .login-card { width: 100%; padding: 40px 24px; }
}

/* ---------------------------------------------------------------- 토스트 */
#req-toasts { position: fixed; top: 24px; right: 24px; z-index: 2000; }
.req-toast {
    width: 384px; background: #fff; border-radius: 4px; box-shadow: 0 3px 6px -4px rgba(0,0,0,.12),
    0 6px 16px 0 rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05);
    padding: 16px 24px; margin-bottom: 16px; display: flex; gap: 12px; position: relative;
}
.req-toast .ico { font-size: 20px; line-height: 22px; }
.req-toast.error .ico { color: #ff4d4f; }
.req-toast.success .ico { color: #52c41a; }
.req-toast.warning .ico { color: #faad14; }
.req-toast .ttl { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.req-toast .msg { font-size: 13px; color: rgba(0, 0, 0, .65); word-break: break-word; }
.req-toast .x {
    position: absolute; top: 12px; right: 12px; border: 0; background: none;
    cursor: pointer; color: rgba(0, 0, 0, .35); font-size: 14px;
}

/* ---------------------------------------------------------------- 기타 */
.errorpage { max-width: 480px; margin: 120px auto; text-align: center; }
.errorpage .code { font-size: 64px; font-weight: 700; color: #1890ff; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 8px 0; border-bottom: 1px dashed #f0f0f0; font-size: 12.5px; }
.hist li .when { color: rgba(0, 0, 0, .4); margin-left: 6px; font-size: 11px; }
.top-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; background: #1890ff;
    z-index: 3000; transition: width .3s ease;
}
