@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css");

:root {
  --primary-color: #0052cc;
  --primary-hover: #003d99;
  --bg-color: #E6F0FA; /* 조금 밝은 파란색 */
  --surface-color: #ffffff;
  --text-primary: #172b4d;
  --text-secondary: #5e6c84;
  --border-color: #dfe1e6;
  --success-color: #00875a;
  --success-bg: #e3fcef;
  --danger-color: #de350b;
  --danger-bg: #ffebe6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header & Nav */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 10px;
}
.top-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}
.top-header .logo {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 18px;
}

.user-info-bar {
  background-color: #d0e2f5;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 500;
}
.user-info-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.user-info-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.user-info-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.user-info-summary-text {
  font-size: 14px;
}
.btn-user-info-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  background-color: white;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-user-info-toggle:hover {
  background-color: #ebecf0;
  color: var(--text-primary);
}
.btn-logout-compact {
  padding: 4px 12px;
  font-size: 12px;
}
.btn-profile-edit-compact {
  padding: 4px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.btn-messenger-compact {
  padding: 4px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.profile-edit-label-short {
  display: none;
}
.user-info-details-panel {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 8px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: stretch;
}
.admin-nav .btn-admin-nav {
  flex: 1 1 0;
  min-width: 0;
}

.notice-write-modal {
  max-width: 560px;
  width: 100%;
}
.notice-target-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.notice-target-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}
.btn-notice-target-action {
  padding: 4px 10px;
  font-size: 12px;
}
.notice-target-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fafbfc;
}
.notice-target-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.notice-target-item input {
  flex-shrink: 0;
}

.messenger-modal {
  max-width: 1180px;
  width: 98vw;
  padding: 0;
  overflow: hidden;
}
.messenger-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 16px 12px;
  background: #0052cc;
  color: #fff;
  border-bottom: none;
}
.messenger-modal-header h3 {
  margin: 0;
  padding-top: 2px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.messenger-close-btn {
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin: -2px 0 0;
  font-family: inherit;
  font-weight: 300;
}
.messenger-close-btn:hover {
  opacity: 0.85;
}
.messenger-close-btn:focus {
  outline: none;
}
.messenger-body {
  display: flex;
  height: 520px;
  min-height: 400px;
}
.messenger-conversations {
  width: 280px;
  max-width: 32%;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  background: #fafbfc;
}
.messenger-conversation-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-family: inherit;
}
.messenger-conversation-item:hover {
  background: #eef2f7;
}
.messenger-conversation-item.active {
  background: #deebff;
}
.messenger-conversation-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.messenger-conversation-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messenger-conversation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}
.messenger-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger-color);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.messenger-chat-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f4f5f7;
}
.messenger-chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}
.messenger-chat-back {
  display: none;
  margin-right: 8px;
  padding: 2px 8px;
  font-size: 12px;
}
.messenger-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.messenger-chat-empty {
  margin: auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}
.chat-bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}
.chat-bubble.sent {
  align-self: flex-end;
  background: #0052cc;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  align-self: flex-start;
  background: #fff;
  color: var(--text-primary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom-left-radius: 4px;
}
.chat-bubble-time {
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.75;
}
.messenger-chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.messenger-chat-input-bar textarea {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 80px;
  max-height: 160px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  overflow-y: auto;
}
.messenger-chat-input-bar textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}
.messenger-chat-send-btn {
  flex-shrink: 0;
  padding: 12px 18px;
  font-size: 14px;
  border-radius: 12px;
  min-height: 44px;
}
.messenger-contacts-section {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.messenger-contact-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
}
.messenger-contact-name {
  font-weight: 600;
  font-size: 13px;
}
.messenger-contact-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary);
}
.messenger-contact-item:hover {
  background: #eef2f7;
}

@media (min-width: 769px) {
  .messenger-chat-panel {
    display: flex;
  }
  .messenger-chat-back {
    display: none !important;
  }
}

.messenger-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.messenger-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
}
.messenger-item:last-child {
  border-bottom: none;
}
.messenger-item.unread {
  background: #f0f6ff;
}
.messenger-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.messenger-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Card */
.card {
  background-color: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.btn.btn-logout-compact,
.btn.btn-profile-edit-compact,
.btn.btn-messenger-compact,
.btn.btn-admin-nav {
  padding: 4px 12px;
  font-size: 12px;
}
.btn-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover) !important;
  color: white !important;
  text-decoration: none !important;
}
.btn-primary:disabled {
  background-color: #a5c2f0;
  cursor: not-allowed;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}
.modal-card {
  background-color: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 450px;
  animation: slideUp 0.2s ease-out;
}
.modal-card.messenger-modal {
  max-width: 1180px;
  width: 98vw;
  padding: 0;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}
.btn-danger:hover {
  background-color: #bf2d09;
}

.btn-secondary {
  background-color: #f4f5f7;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: #ebecf0;
}

/* Merged Recent Cell inside 번호 column */
.recent-cell-merged {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: nowrap;
  max-width: 100%;
}
.recent-cell-merged .badge-recent {
  margin: 0;
  flex-shrink: 0;
}
.recent-cell-merged .btn-read-doc {
  padding: 1px 4px;
  font-size: 10px;
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Premium Outline Document Link Button */
.btn-open-doc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-color);
  background-color: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}
.btn-open-doc:hover {
  color: white !important;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  text-decoration: none !important;
}

/* Table */
.table-wrapper {
  overflow-x: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.list-container-card .table-wrapper {
  border: none;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface-color);
  font-size: 14px;
}

.text-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

.table.table-list {
  table-layout: fixed;
  width: 100%;
  --list-row-height: 88px;
}

.table.table-list tbody td {
  height: var(--list-row-height);
  max-height: var(--list-row-height);
  vertical-align: middle;
  overflow: hidden;
  box-sizing: border-box;
}

.table.table-list tbody td.cell-num {
  overflow: hidden;
  padding: 6px 4px;
}

.table.table-list .cell-num-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.table.table-list .cell-num-value {
  font-weight: 600;
  line-height: 1.2;
  flex-shrink: 0;
}

.table.table-list tbody td.empty-row {
  height: auto;
  max-height: none;
}

.table.table-list .text-clamp-3 {
  font-size: 13px;
  max-height: calc(1.35em * 3);
}

.table.table-list td.text-center:not(.cell-num) .text-clamp-3 {
  text-align: center;
}

.table.table-list col.col-num { width: 9%; }
.table.table-list col.col-sender { width: 10%; }
.table.table-list col.col-receiver { width: 10%; }
.table.table-list col.col-title { width: 39%; }
.table.table-list col.col-meta { width: 18%; }
.table.table-list col.col-status { width: 14%; }

.table.table-list.edit-mode col.col-select { width: 4%; }
.table.table-list.edit-mode col.col-num { width: 8%; }
.table.table-list.edit-mode col.col-sender { width: 9%; }
.table.table-list.edit-mode col.col-receiver { width: 9%; }
.table.table-list.edit-mode col.col-title { width: 35%; }
.table.table-list.edit-mode col.col-meta { width: 18%; }
.table.table-list.edit-mode col.col-status { width: 12%; }

.table.table-list .cell-doc-meta {
  line-height: 1.35;
  font-size: 12px;
  white-space: normal;
}

.table.table-list .doc-meta-date {
  color: var(--text-primary);
}

.table.table-list .doc-meta-draft {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 2px;
}
.table.table-list th,
.table.table-list td {
  padding: 8px 6px;
  font-size: 13px;
}
.table.table-list th {
  white-space: normal;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-align: center;
}
.table th, .table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}
.table th:last-child, .table td:last-child {
  border-right: none;
}
.table th {
  background-color: #f4f5f7;
  font-weight: 600;
  text-align: left;
  color: var(--text-secondary);
  white-space: nowrap;
}
.table tbody tr {
  transition: background-color 0.15s;
}
.table tbody tr:hover {
  background-color: #fafbfc;
}
.text-center {
  text-align: center !important;
}

.table .text-center {
  white-space: nowrap;
}

.recent-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.recent-cell .btn-read-doc {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
}

.badge-completed,
.badge-pending,
.badge-rejected {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-completed {
  background-color: var(--success-bg);
  color: var(--success-color);
}

.badge-pending {
  background-color: #fff7e6;
  color: #b38600;
}

.badge-status-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease;
}

.badge-status-btn:hover {
  filter: brightness(0.94);
}

.approval-status-modal {
  max-width: 420px;
}

.approval-status-doc-title {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-muted, #666);
  word-break: break-word;
}

.approval-status-summary {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success-color, #00875a);
}

.approval-status-body {
  max-height: 60vh;
  overflow-y: auto;
}

.approval-status-section {
  margin-top: 16px;
}

.approval-status-section:first-child {
  margin-top: 8px;
}

.approval-status-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #666);
}

.approval-status-list {
  border: 1px solid var(--border-color, #e8e8e8);
  border-radius: 6px;
  padding: 4px 12px;
  background: var(--surface-muted, #fafafa);
}

.approval-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color, #eee);
}

.approval-status-item:last-child {
  border-bottom: none;
}

.approval-status-date {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted, #888);
  white-space: nowrap;
}

.approval-status-empty {
  margin: 8px 0;
  font-size: 13px;
  color: var(--text-muted, #999);
}

.badge-rejected {
  background-color: #ffebe6;
  color: var(--danger-color);
}

.detail-page-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.resubmit-banner {
  background: #fff7e6;
  border: 1px solid #ffd666;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.resubmit-banner a {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
}

.status-cell-rejected {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.btn-resubmit {
  font-size: 11px;
  padding: 3px 8px;
  line-height: 1.3;
  white-space: nowrap;
}

.admin-user-toolbar {
  padding: 16px;
  margin-bottom: 16px;
}

.admin-user-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-user-filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-user-filter-select {
  width: auto;
  min-width: 140px;
}

.admin-user-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.admin-user-search-bar .form-control {
  flex: 1;
  min-width: 0;
}

.badge-pending-approval {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background-color: #fff7e6;
  color: #b38600;
}

.admin-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: #fafbfc;
  flex-wrap: wrap;
}

.admin-edit-bar[hidden] {
  display: none !important;
}

.admin-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-edit-actions[hidden] {
  display: none !important;
}

.edit-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.edit-mode-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.edit-mode-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: #c1c7d0;
  border-radius: 999px;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.edit-mode-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.edit-mode-toggle input:checked + .edit-mode-toggle-track {
  background-color: var(--primary-color);
}

.edit-mode-toggle input:checked + .edit-mode-toggle-track::after {
  transform: translateX(20px);
}

.edit-mode-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.table.table-list th.admin-select-col,
.table.table-list td.admin-select-col {
  width: 4%;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.mobile-doc-select {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}

.mobile-doc-select input {
  width: 16px;
  height: 16px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
  background-color: #f4f5f7;
  color: var(--text-primary);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.member-chip:hover {
  filter: brightness(0.95);
}

.member-chip-static {
  cursor: default;
  background-color: #f4f5f7;
  color: var(--text-primary);
}

.member-chip-static:hover {
  background-color: #f4f5f7;
  filter: none;
}

.member-chip-preview {
  cursor: default;
  margin-bottom: 12px;
}

.member-chip-preview:hover {
  filter: none;
}

.member-chip-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  max-width: 100%;
}

.member-chip-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

.mobile-meta-row-chips {
  align-items: flex-start;
  gap: 6px;
}

.mobile-meta-row-chips .member-chip-wrap {
  flex: 1;
  min-width: 0;
}

.mobile-meta-row-chips .member-chip-group {
  flex-direction: column;
  align-items: stretch;
}

.table.table-list td.cell-person {
  vertical-align: middle;
  text-align: center;
}

.table.table-list td.cell-person .member-chip-wrap {
  align-items: center;
}

.table.table-list td.cell-person .member-chip,
.table.table-list td.cell-person .member-chip-group {
  margin: 0 auto;
}

.member-view-value {
  padding: 8px 12px;
  background-color: #f4f5f7;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}

.member-view-note {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--danger-color);
}

.cell-wrap {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  min-width: 120px;
}

.table.table-list .cell-wrap {
  min-width: 0;
}

.table.table-list .cell-wrap,
.table.table-list .cell-title,
.table.table-list .cell-person {
  overflow: hidden;
  max-width: 100%;
}

.table.table-list .cell-person .text-clamp-3,
.table.table-list .cell-title .text-clamp-3 {
  display: -webkit-box;
  width: 100%;
  max-width: 100%;
}

.table.table-list .cell-person .text-clamp-3 {
  font-size: 12px;
}

.table.table-list td.text-center .badge-pending,
.table.table-list td.text-center .badge-completed,
.table.table-list td.text-center .badge-rejected {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

.table .col-title {
  width: auto;
}

.table .cell-title {
  width: auto;
  vertical-align: middle;
  position: relative;
  padding: 0;
}

.table.table-list .cell-title-link {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: var(--list-row-height);
  padding: 8px 6px;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
}

.table.table-list .cell-title-link:hover {
  background-color: #eef1f5;
}

.table.table-list .cell-title-link:hover .text-clamp-3 {
  text-decoration: underline;
}

.table.table-list .cell-title-link .text-clamp-3 {
  width: 100%;
}

.table .cell-title a:not(.cell-title-link) {
  text-decoration: underline;
}

.table.table-admin {
  table-layout: fixed;
  --list-row-height: 84px;
}

.table.table-admin tbody td {
  height: var(--list-row-height);
  max-height: var(--list-row-height);
  vertical-align: middle;
  overflow: hidden;
}

.table.table-admin .text-clamp-3 {
  font-size: 13px;
  max-height: calc(1.35em * 3);
}

.link-attach-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.link-attach-form #linkUrl {
  grid-column: 1 / -1;
}

.link-attach-form #addLinkBtn {
  grid-column: 1 / -1;
  justify-self: start;
}

.link-attachment-list,
.file-attachment-list,
#attachedFilesList,
#attachedLinksList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-preview-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.link-preview-card:hover {
  border-color: #b3d4ff;
  box-shadow: 0 2px 8px rgba(0, 82, 204, 0.08);
  text-decoration: none;
}

.link-preview-card-editable {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.link-preview-card-body {
  flex: 1;
  min-width: 0;
}

.link-preview-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-word;
}

.link-preview-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.link-preview-domain {
  font-size: 13px;
  color: #00875a;
  word-break: break-all;
}

.link-remove-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  white-space: nowrap;
}

.link-remove-btn:hover {
  text-decoration: underline;
}


.detail-content,
.detail-meta,
.comment-body {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.detail-content p,
.comment-body p {
  margin: 0;
  padding: 0;
}

/* Quill 빈 줄(<p><br></p>)만 높이 유지 */
.detail-content p.ql-blank-line,
.comment-body p.ql-blank-line {
  min-height: 1em;
}

.plain-text-content {
  white-space: pre-wrap;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.badge-danger {
  background-color: var(--danger-color);
  color: white;
}
.badge-success {
  background-color: var(--success-bg);
  color: var(--success-color);
  border: 1px solid #b3dfc7;
}

/* Signature Pad */
.signature-wrapper {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background-color: #fafbfc;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  min-height: 200px;
  height: 200px;
}
.signature-wrapper.active {
  border-color: var(--primary-color);
  background-color: #fff;
}
.signature-pad {
  width: 100%;
  height: 100%;
  cursor: crosshair;
  display: block;
  touch-action: none;
  user-select: none;
}
.signature-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* Approval Flow Table in Detail */
.approval-line {
  display: flex;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
}
.approval-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
}
.approval-box:last-child {
  border-right: none;
}
.approval-title {
  background-color: #f4f5f7;
  padding: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}
.approval-sign {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.approval-sign img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.approval-status {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  background-color: #fafbfc;
}

/* Comments */
.comments-section {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}
.comment-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.comment-content {
  flex: 1;
  background-color: #f4f5f7;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
}
.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
}
.comment-author {
  font-weight: 600;
}
.comment-date {
  color: var(--text-secondary);
}
.comment-input-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.comment-input-wrapper .form-control {
  flex: 1;
  min-width: 0;
}
.comment-input-wrapper .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.file-viewer-section {
  margin-bottom: 24px;
}
.file-viewer-item {
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-color);
}
.file-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f4f5f7;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
}
.file-viewer-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fafbfc;
}
.file-viewer-body iframe,
.file-viewer-body embed {
  display: block;
  width: 100%;
  height: 600px;
  border: none;
  background: #fafbfc;
}

#previewModalBody.preview-body-centered {
  display: flex;
  align-items: center;
  justify-content: center;
}

#previewModalBody.preview-body-scroll {
  display: block;
  align-items: stretch;
  justify-content: flex-start;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.pdf-preview-container {
  width: 100%;
  min-height: 100%;
  padding: 12px;
  box-sizing: border-box;
}

.pdf-preview-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 16px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.preview-loading,
.preview-message,
.preview-error {
  padding: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.page-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.page-loading-state p {
  margin: 0;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8ecf1;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.list-loading-panel,
.detail-loading-panel {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-loading-panel[hidden],
.detail-loading-panel[hidden],
#listContent[hidden],
#detailBody[hidden] {
  display: none !important;
}

.preview-error {
  color: var(--danger-color, #de350b);
}

.server-version-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.profile-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
}
.profile-modal-actions-right {
  display: flex;
  gap: 10px;
}

/* Email Suggestions Autocomplete Dropdown */
.email-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.email-input-wrapper .email-input {
  flex: 1;
  min-width: 0;
}

.email-remove-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.email-remove-btn:hover:not(:disabled) {
  color: var(--danger-color);
  border-color: var(--danger-color);
  background-color: #fff5f5;
}

.email-remove-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.suggestions-group-title {
  background-color: #f4f5f7;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: bold;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f4f5f7;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: #f0f5ff;
  color: var(--primary-color);
}

.suggestion-email {
  font-weight: 500;
}

.suggestion-name {
  color: var(--text-secondary);
  font-size: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--primary-hover);
}

.file-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background-color: #fafbfc;
  transition: border-color 0.2s, background-color 0.2s;
}

.file-drop-zone.drag-over {
  border-color: var(--primary-color);
  background-color: #e6f0ff;
}

.file-drop-text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.file-drop-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.file-list {
  list-style: none;
  margin-top: 10px;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  font-size: 13px;
  background-color: var(--surface-color);
}

.file-list li a {
  text-decoration: underline;
}

.file-remove-btn {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
}

.file-remove-btn:hover {
  text-decoration: underline;
}

/* Submit Action Button Wrapper */
.submit-action-wrapper {
  text-align: right;
  margin-top: 20px;
}
#submitDraftBtn {
  padding: 12px 30px;
  font-size: 16px;
}

/* Detail Action Buttons Wrapper */
.detail-actions-wrapper {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 15px;
}

/* Visibility helpers */
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

/* List container card default */
.list-container-card {
  background-color: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}

/* Quill WYSIWYG Editor custom theme styling */
.ql-toolbar.ql-snow {
  border: 1px solid var(--border-color) !important;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  background-color: #f4f5f7;
}
.ql-container.ql-snow {
  border: 1px solid var(--border-color) !important;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
}
.detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  body {
    font-size: 14px;
  }

  /* Visibility helpers */
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  /* List container card 투명화 */
  .list-container-card {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 16px;
    border-radius: 0 !important;
  }

  /* Top Header mobile layout */
  .top-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 8px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
  }

  .top-header h1 {
    font-size: 17px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.5px;
  }

  .top-header .logo {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 0;
    letter-spacing: 0.5px;
  }

  /* Collapsible User Info Bar mobile styles */
  .user-info-bar {
    padding: 10px 14px;
    gap: 8px;
  }
  .user-info-summary-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .user-info-summary-text {
    width: 100%;
  }
  .user-info-actions {
    width: 100%;
    margin-left: 0;
  }
  .user-info-action-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .user-info-action-group .btn-user-info-toggle,
  .user-info-action-group .btn-profile-edit-compact,
  .user-info-action-group .btn-messenger-compact,
  .user-info-action-group .btn-logout-compact {
    width: 100%;
    min-width: 0;
    padding: 6px 4px;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
  }
  .profile-edit-label-full {
    display: none;
  }
  .profile-edit-label-short {
    display: inline;
  }
  .btn-user-info-toggle {
    display: block;
    margin-left: 0;
    margin-right: 0;
  }
  .user-info-details-panel {
    flex-direction: column;
    gap: 6px;
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 8px;
  }
  .user-info-detail-item {
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    padding-bottom: 4px;
  }
  .user-info-detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .messenger-body {
    height: 75vh;
    max-height: 580px;
    min-height: 420px;
    position: relative;
  }
  .messenger-conversations {
    width: 100%;
  }
  .messenger-body.chat-open .messenger-conversations {
    display: none;
  }
  .messenger-body.chat-open .messenger-chat-panel {
    display: flex;
  }
  .messenger-chat-panel {
    display: none;
    width: 100%;
  }
  .messenger-body.chat-open .messenger-chat-back {
    display: inline-flex;
  }

  /* Mobile Document Card List Styles */
  .mobile-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .mobile-doc-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    min-height: 168px;
  }
  .mobile-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid #f4f5f7;
    padding-bottom: 8px;
  }
  .mobile-doc-num {
    font-weight: 700;
    color: var(--primary-color);
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .mobile-doc-badges {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .mobile-doc-date {
    font-weight: 500;
  }
  .mobile-doc-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .mobile-doc-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    min-height: calc(1.35em * 3);
  }

  .mobile-doc-title a {
    color: var(--text-primary);
    text-decoration: underline;
  }
  .mobile-doc-title a:hover {
    color: var(--primary-color);
  }
  .mobile-doc-meta {
    background-color: #f8fafc;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .mobile-meta-row {
    color: var(--text-primary);
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: 4px;
  }

  .mobile-meta-row .text-clamp-3 {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    max-height: calc(1.35em * 3);
  }

  .mobile-meta-row strong {
    color: var(--text-secondary);
    font-weight: 600;
    display: inline-block;
    width: 60px;
  }
  .mobile-empty-message {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
  }

  .card {
    padding: 16px;
  }

  .page-header,
  .list-page-title-row {
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-header .btn,
  .page-header a.btn,
  #adminNav .btn,
  .admin-nav .btn-admin-nav {
    margin-left: 0 !important;
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .link-attach-form {
    grid-template-columns: 1fr;
  }

  .table .cell-title,
  .table .col-title {
    width: auto;
  }

  .list-page-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .list-search-bar {
    max-width: none;
    width: 100%;
  }

  .admin-user-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-user-filter-select {
    width: 100%;
  }

  .admin-user-search-bar {
    max-width: none;
    width: 100%;
  }

  .list-search-bar .btn,
  #docSearchBtn {
    width: auto !important;
  }

  .list-page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .list-page-actions button,
  .list-page-actions a.btn {
    flex: none !important;
    width: 100%;
    text-align: center;
    justify-content: center;
    margin: 0 !important;
    font-size: 13px;
    padding: 8px 12px;
  }

  .list-page-actions button:nth-child(1) { grid-column: 1; }
  .list-page-actions button:nth-child(2) { grid-column: 2; }
  .list-page-actions a.btn-primary { grid-column: span 2; }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
  }

  .table {
    min-width: 850px;
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 8px 10px;
  }

  .approval-line {
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .approval-box {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .approval-box:last-child {
    border-bottom: none;
  }

  .approval-sign {
    height: 60px;
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .comment-input-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .comment-input-wrapper .form-control {
    width: 100%;
  }

  .comment-input-wrapper .btn {
    width: 100%;
  }

  .profile-modal-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .profile-modal-actions-right {
    justify-content: stretch;
    display: flex;
    gap: 8px;
  }

  .profile-modal-actions-right .btn {
    flex: 1;
  }

  .modal-card {
    width: 92%;
    padding: 20px;
    margin: 0 auto;
    max-width: calc(100vw - 24px);
  }
  .modal-card.messenger-modal {
    width: 98%;
    max-width: calc(100vw - 12px);
    padding: 0;
  }

  /* Responsive action buttons */
  .submit-action-wrapper {
    text-align: center;
  }

  #submitDraftBtn {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
  }

  .detail-actions-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .detail-actions-wrapper .btn {
    width: 100%;
  }
}
