/* ===== 올데이 관세사무소 — Django Admin 브랜드 테마 ===== */

:root {
  --primary: #14365c;
  --secondary: #0f2a4a;
  --accent: #c19a3e;
  --primary-fg: #ffffff;

  --header-color: #ffffff;
  --header-branding-color: #c19a3e;
  --header-bg: #0f2a4a;
  --header-link-color: #ffffff;

  --breadcrumbs-fg: #cdd9e8;
  --breadcrumbs-link-fg: #ffffff;
  --breadcrumbs-bg: #14365c;

  --link-fg: #14365c;
  --link-hover-color: #c19a3e;
  --link-selected-fg: #0f2a4a;

  --button-bg: #c19a3e;
  --button-fg: #ffffff;
  --button-hover-bg: #a8842f;
  --default-button-bg: #0f2a4a;
  --default-button-hover-bg: #14365c;
  --object-tools-bg: #0f2a4a;
  --object-tools-fg: #ffffff;
  --object-tools-hover-bg: #14365c;

  --selected-row: #faf4e6;
  --selected-bg: #f3eede;

  --body-fg: #2a3340;
  --link-fg: #14365c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --header-bg: #0c2138;
    --header-branding-color: #d4b15e;
    --accent: #d4b15e;
    --button-bg: #c19a3e;
    --button-hover-bg: #a8842f;
    --object-tools-bg: #14365c;
    --link-hover-color: #d4b15e;
    --breadcrumbs-bg: #14365c;
  }
}

/* ----- 전체 톤 ----- */
body {
  font-family: 'Noto Sans KR', 'Malgun Gothic', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, sans-serif;
}

/* ----- 상단 헤더 ----- */
#header {
  padding: 18px 40px;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 12px -6px rgba(15, 42, 74, .45);
}
#branding h1 { font-weight: 800; }
#site-name a { text-decoration: none; }
.ad-mark { color: #fff; font-weight: 800; letter-spacing: .01em; }
.ad-light { color: #c9d6e6; font-weight: 600; }
.ad-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: #0f2a4a;
  background: var(--accent);
  border-radius: 20px;
  padding: 2px 10px;
  vertical-align: 2px;
}
#user-tools { font-size: 12.5px; }

/* ----- 빵부스러기 ----- */
div.breadcrumbs { padding: 12px 40px; font-size: 13px; }

/* ----- 본문 영역 ----- */
#content { padding: 28px 40px; }
#content > h1 {
  font-weight: 800;
  color: #0f2a4a;
  letter-spacing: -.01em;
}

/* ----- 모듈 카드 ----- */
.module {
  border: 1px solid rgba(15, 42, 74, .10);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 34px -26px rgba(15, 42, 74, .5);
  margin-bottom: 22px;
}
.module caption,
.module h2,
.inline-group h2,
.module table caption {
  background: #0f2a4a;
  color: #fff;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 12px 16px;
  font-size: 12.5px;
  text-transform: none;
}
.dashboard .module table th { font-weight: 600; }
.module table tr:hover { background: #faf6ec; }

/* 대시보드 앱 목록 링크 */
.dashboard #content-main .module a { font-weight: 600; }
.addlink, .changelink, .deletelink, .viewlink { font-weight: 600; }

/* ----- 버튼 ----- */
a.button, input[type=submit], input[type=button],
.submit-row input, .button {
  border-radius: 9px;
  padding: 10px 18px;
  font-weight: 700;
  letter-spacing: .01em;
}
.object-tools a {
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .03em;
}
.submit-row input.default { background: var(--accent); }
.submit-row input.default:hover { background: var(--button-hover-bg); }

/* ----- 테이블 헤더 ----- */
#changelist table thead th {
  background: #f5f2ea;
  border-bottom: 2px solid rgba(15, 42, 74, .12);
}
#changelist table thead th a { color: #0f2a4a; font-weight: 700; }

/* 선택된 행 / 액션바 */
#changelist .actions {
  background: #faf6ec;
  border: 1px solid #ecdfc2;
  border-radius: 10px;
  padding: 10px 14px;
}

/* ----- 폼 입력 ----- */
.form-row input[type=text], .form-row input[type=email],
.form-row input[type=password], .form-row input[type=number],
.form-row textarea, .form-row select, .vTextField {
  border: 1.5px solid #d9dee6;
  border-radius: 9px;
  padding: 8px 11px;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 154, 62, .18);
  outline: none;
}
fieldset.module { border-radius: 14px; }

/* ----- 로그인 화면 ----- */
body.login #container {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 70px -45px rgba(15, 42, 74, .6);
  border: 1px solid rgba(15, 42, 74, .08);
}
body.login #header { padding: 22px 30px; }
body.login .submit-row { padding: 0; }
body.login .submit-row input {
  width: 100%;
  background: var(--accent);
  padding: 13px;
  font-size: 15px;
}
body.login .submit-row input:hover { background: var(--button-hover-bg); }

/* 페이지네이션/선택 강조 */
.paginator .this-page { background: var(--accent); border-radius: 6px; }

/* ===== 통관 의뢰 운영 리스트 ===== */
.adl-file {
  display: inline-block;
  background: #faf6ec;
  border: 1px solid #ecdfc2;
  color: #8a6a1e;
  border-radius: 7px;
  padding: 2px 8px;
  margin: 1px 2px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.adl-file:hover { background: #f2e7c9; color: #6b4f12; }

#changelist table td, #changelist table th { vertical-align: middle; }
#changelist .field-attachments { line-height: 1.9; }

/* 자동 새로고침 바 (고정) */
#adl-refresh {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  background: #0f2a4a;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 24px;
  box-shadow: 0 12px 30px -12px rgba(15, 42, 74, .6);
  display: flex;
  align-items: center;
  gap: 6px;
}
#adl-refresh a { color: #c19a3e; font-weight: 700; text-decoration: none; }
#adl-refresh a:hover { text-decoration: underline; }
#adl-refresh b { color: #c19a3e; }
#adl-refresh .adl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #59d08a; display: inline-block;
  animation: adl-pulse 1.6s ease-in-out infinite;
}
#adl-refresh.paused .adl-dot { background: #b9c2cf; animation: none; }
@keyframes adl-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ===== select(드롭다운) 글자 잘림 보정 ===== */
.form-row select, .module select, select {
  min-width: 160px;
  height: auto;
  padding: 7px 30px 7px 11px;   /* 우측은 화살표 공간 */
  font-size: 13.5px;
  line-height: 1.4;
  border: 1.5px solid #d9dee6;
  border-radius: 9px;
  background-color: #fff;
  appearance: auto;
  -webkit-appearance: menulist;
}
/* 회원 선택 등 관계형 셀렉트는 좀 더 넓게 */
.form-row .related-widget-wrapper select,
.form-row select[name="owner"] {
  min-width: 280px;
  max-width: 100%;
}
/* 변경폼 입력칸 공통 여유 */
.form-row input[type=text], .form-row input[type=email], .vTextField {
  min-width: 240px;
}

/* ===== 통관 의뢰 현황판 ===== */
.allday-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 22px;
}
.allday-stats .stat {
  flex: 1 1 120px;
  background: #fff;
  border: 1px solid rgba(15, 42, 74, .1);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 12px 30px -24px rgba(15, 42, 74, .5);
  text-decoration: none;
  border-left: 4px solid #c19a3e;
}
.allday-stats .stat-new { border-left-color: #9a6700; }
.allday-stats .stat-prog { border-left-color: #2c5b9c; }
.allday-stats .stat-done { border-left-color: #1c7a4a; }
.allday-stats .stat-total { border-left-color: #0f2a4a; }
.allday-stats .stat-users { border-left-color: #b5510a; background: #fff9f2; }
.allday-stats .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #0f2a4a;
  line-height: 1.1;
}
.allday-stats .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7785;
  margin-top: 4px;
}
.allday-stats a.stat:hover { background: #fdeee0; }

/* ===== 관리자 로그인 화면 '홈으로' 링크 ===== */
.adl-login-home {
  text-align: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef1f5;
}
.adl-login-home a {
  color: #6b7785;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.adl-login-home a:hover { color: #c19a3e; }
