/* =========================================================
   INSURANCE POLICY MANAGER
   MAIN STYLESHEET
========================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  --dark: #111827;
  --dark-2: #1f2937;

  --text: #1f2937;
  --muted: #6b7280;

  --border: #e5e7eb;
  --background: #f5f7fb;
  --surface: #ffffff;
  --white: #ffffff;

  --shadow: 0 8px 30px rgba(15, 23, 42, 0.07);

  --radius: 12px;
}

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--background);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* =========================================================
   LOGIN
========================================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.login-card {
  width: min(420px, 92%);
  background: var(--white);
  padding: 40px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logo-circle {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: white;
  font-size: 22px;
  font-weight: 800;
}

.login-card h1 {
  font-size: 26px;
}

.login-card > p {
  color: var(--muted);
  margin: 8px 0 30px;
}

/* =========================================================
   APP
========================================================= */

.app {
  min-height: 100vh;
  display: flex;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  width: 250px;
  min-height: 100vh;
  background: var(--dark);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 15px;
}

.sidebar-brand span {
  color: #9ca3af;
  font-size: 11px;
  margin-top: 3px;
}

.sidebar-nav {
  padding: 20px 12px;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 5px;
  border: 0;
  background: transparent;
  color: #d1d5db;
  border-radius: 8px;
  text-align: left;
  transition: 0.2s;
  font-size: 14px;
}

.nav-item span {
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.session-mini {
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9ca3af;
}

.session-mini strong {
  color: white;
}

/* =========================================================
   MAIN
========================================================= */

.main-content {
  width: calc(100% - 250px);
  margin-left: 250px;
  min-height: 100vh;
}

.top-header {
  height: 80px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
}

.header-left {
  gap: 15px;
}

.header-left h2 {
  font-size: 20px;
}

.header-left span {
  color: var(--muted);
  font-size: 12px;
}

.header-right {
  gap: 18px;
}

.mobile-only {
  display: none !important;
}

/* =========================================================
   PROFILE
========================================================= */

.profile-wrapper,
.notification-wrapper {
  position: relative;
}

.view-all-wrapper {
  position: relative;
  display: inline-block;
  z-index: 1001;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  text-align: left;
}

.profile-name strong,
.profile-name small {
  display: block;
}

.profile-name strong {
  font-size: 13px;
}

.profile-name small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 10px;
  overflow: hidden;
  z-index: 1000;
}

.view-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 9px;
  overflow: hidden;
  z-index: 1100;
}

.profile-dropdown button,
.view-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: white;
  border: 0;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.profile-dropdown button:hover,
.view-dropdown button:hover {
  background: #f3f4f6;
}

/* =========================================================
   NOTIFICATION
========================================================= */

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 0;
  position: relative;
  font-size: 18px;
}

.notification-badge {
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 9px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.notification-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 350px;
  max-height: 430px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  z-index: 1000;
}

.notification-header {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

.notification-item {
  padding: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.notification-item strong {
  display: block;
  font-size: 13px;
}

.notification-item small {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}

.notification-item.warning {
  border-left: 3px solid var(--warning);
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
}

.empty-small {
  padding: 25px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* =========================================================
   PAGE
========================================================= */

.page-container {
  padding: 28px;
}

.content-page {
  display: none;
}

.content-page.active {
  display: block;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}

.policy-heading {
  position: sticky;
  top: 80px;

  z-index: 40;

  background: #f8fafc;

  padding-top: 12px;
  padding-bottom: 15px;

  margin-top: -12px;
  margin-bottom: 18px;

  border-bottom: 1px solid var(--border);
}

.page-heading h1 {
  font-size: 25px;
}

.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.heading-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
}

/* =========================================================
   BUTTONS
========================================================= */

.btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: #f9fafb;
}

.btn-warning {
  background: #fff7ed;
  color: var(--warning);
  border: 1px solid #fed7aa;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-small {
  padding: 8px 12px;
}

.full-width {
  width: 100%;
}

/* =========================================================
   STATS
========================================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.stat-icon.blue {
  background: #dbeafe;
  color: var(--primary);
}

.stat-icon.green {
  background: #dcfce7;
  color: var(--success);
}

.stat-icon.gold {
  background: #fef3c7;
}

.stat-icon.red {
  background: #fee2e2;
  color: var(--danger);
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
  display: block;
}

.stat-card strong {
  display: block;
  font-size: 22px;
  margin-top: 5px;
}

.view-only-label {
  position: absolute;
  right: 12px;
  top: 10px;
  color: #9ca3af;
  font-size: 8px;
}

/* =========================================================
   CARDS
========================================================= */

.card,
.form-section,
.filter-card,
.profile-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

.card {
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 16px;
}

.card-header p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

/* =========================================================
   FORMS
========================================================= */

.form-section {
  margin-bottom: 20px;
  padding: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.section-title > span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.section-title h3 {
  font-size: 16px;
}

.section-title p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
}

.form-group {
  min-width: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}

.form-group label span {
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 7px;
  padding: 10px 11px;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.form-group input[readonly] {
  background: #f3f4f6;
  cursor: not-allowed;
}

.full-span {
  grid-column: 1 / -1;
}

.field-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.field-error {
  color: var(--danger);
  font-size: 11px;
  margin-top: 5px;
  min-height: 15px;
}

.calculated input {
  background: #f8fafc !important;
  font-weight: 700;
}

.gross-s-field input {
  background: #ecfdf5 !important;
}

.calculation-info {
  margin-top: 18px;
  padding: 11px 13px;
  background: #eff6ff;
  border-left: 3px solid var(--primary);
  border-radius: 5px;
  font-size: 11px;
  color: #374151;
}

/* =========================================================
   TABLE
========================================================= */

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

th {
  background: #f8fafc;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

td {
  font-size: 12px;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fafafa;
}

.negative {
  color: var(--danger) !important;
  font-weight: 700;
}

.positive {
  color: var(--success);
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
}

.status-expired {
  background: #fee2e2;
  color: #b91c1c;
}

.status-draft {
  background: #fef3c7;
  color: #92400e;
}

.table-action {
  border: 0;
  background: transparent;
  font-size: 15px;
  margin-right: 6px;
}

.edit-action {
  color: var(--primary);
}

.delete-action {
  color: var(--danger);
}

.list-action {
  color: var(--primary);
}

/* =========================================================
   FILTER
========================================================= */

.filter-card {
  padding: 15px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
}

.filter-card input,
.filter-card select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
}

/* =========================================================
   DOCUMENT UPLOAD
========================================================= */

.document-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.document-upload {
  min-height: 165px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 10px;
  text-align: center;
  cursor: pointer;
  background: #fafcff;
  transition: 0.2s;
  position: relative;
}

.document-upload:hover {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-1px);
}

.document-upload input {
  display: none;
}

.upload-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: #eff6ff;
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 10px;
}

.document-upload strong {
  font-size: 12px;
}

.document-upload span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}

.selected-file {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--success);
  font-size: 9px;
  margin-top: 8px;
}

/* =========================================================
   BULK UPLOAD
========================================================= */

.bulk-upload-card {
  padding: 50px 30px;
  text-align: center;
}

.bulk-upload-icon {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: var(--primary);
  font-size: 30px;
}

.bulk-upload-card h3 {
  font-size: 20px;
}

.bulk-upload-card p {
  max-width: 500px;
  margin: 8px auto 25px;
  color: var(--muted);
  font-size: 13px;
}

.big-file-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 450px;
  min-height: 130px;
  margin: 0 auto 18px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  cursor: pointer;
}

.big-file-input input {
  display: none;
}

.big-file-input span {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.big-file-input small {
  color: var(--muted);
  margin-top: 7px;
}

.bulk-result {
  margin-top: 18px;
  font-size: 12px;
}

/* =========================================================
   PROFILE
========================================================= */

.profile-card {
  padding: 30px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 35px;
}

.profile-photo-section {
  text-align: center;
}

.large-profile-avatar {
  width: 145px;
  height: 145px;
  border-radius: 50%;
  margin: 0 auto 15px;
  overflow: hidden;
  background: #dbeafe;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 800;
}

.large-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-upload-btn {
  display: inline-block;
  padding: 8px 13px;
  border-radius: 7px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.photo-upload-btn input {
  display: none;
}

.profile-form {
  padding-top: 5px;
}

/* =========================================================
   SETTINGS
========================================================= */

.settings-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.settings-grid .card {
  padding: 20px;
}

.dropdown-options-list {
  margin-top: 15px;
}

.dropdown-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  margin-bottom: 7px;
}

.dropdown-option-row span {
  font-size: 12px;
}

.option-actions button {
  border: 0;
  background: transparent;
  font-size: 12px;
  margin-left: 8px;
}

.add-option-btn {
  margin-top: 10px;
}

/* =========================================================
   MODALS
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  width: min(650px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 15px;
  padding: 25px;
  position: relative;
}

.small-modal {
  width: min(400px, 95vw);
}

.large-modal {
  width: min(1450px, 96vw);
}

.modal-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: #ffffff;
  color: #6b7280;

  font-size: 22px;
  line-height: 1;

  cursor: pointer;

  box-sizing: border-box;
}

.large-modal .modal-header .modal-actions {
  margin-left: auto;
  padding-left: 12px;
}

.large-modal .modal-header .modal-actions .btn {
  flex-shrink: 0;
}

.modal-box h2 {
  margin-bottom: 8px;
}

.modal-box > p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 20px;
}

.modal-icon {
  font-size: 30px;
  margin-bottom: 10px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.modal-header p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: nowrap;
}

.bottom-actions {
  margin-top: 22px;
  justify-content: flex-end;
}

#pinInput {
  width: 100%;
  text-align: center;
  letter-spacing: 10px;
  font-size: 25px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

/* =========================================================
   SESSION WARNING
========================================================= */

.session-warning {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 5000;
  background: white;
  border-left: 4px solid var(--warning);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 330px;
}

.warning-icon {
  font-size: 25px;
}

.session-warning p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

/* =========================================================
   TOAST
========================================================= */

.toast-container {
  position: fixed;
  right: 20px;
  top: 95px;
  z-index: 6000;
}

.toast {
  background: #111827;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .document-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: 0.25s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    width: 100%;
    margin-left: 0;
  }

  .mobile-only {
    display: inline-grid !important;
  }

  .profile-name {
    display: none;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .top-header {
    padding: 0 15px;
  }

  .page-container {
    padding: 15px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .document-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-card {
    grid-template-columns: 1fr;
  }

  .notification-panel {
    width: 300px;
    right: -60px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .document-grid {
    grid-template-columns: 1fr;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .btn {
    flex: 1;
  }
}

#monthSTotal.negative-amount {
  color: #dc2626 !important;
}

/* =========================================================
   DOCUMENT VIEWER
========================================================= */

.documents-view-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.document-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.document-view-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.document-view-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f3f4f6;
  font-size: 20px;
  flex-shrink: 0;
}

.document-view-info strong {
  display: block;
  font-size: 14px;
}

.document-view-info small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.document-view-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.document-not-uploaded {
  color: #9ca3af;
  font-size: 12px;
}

.document-multiple-section {
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.document-section-heading {
  margin-bottom: 12px;
}

.document-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.document-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9fafb;
}

.document-file-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-empty-text {
  color: #9ca3af;
  font-size: 13px;
  padding-top: 4px;
}

@media (max-width: 700px) {
  .document-view-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-view-actions {
    width: 100%;
  }

  .document-view-actions .btn {
    flex: 1;
  }

  .document-file-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

.selected-files-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  width: 100%;
}

.selected-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  box-sizing: border-box;
}

.selected-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.selected-file-icon {
  width: 27px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
  font-size: 13px;
}

.selected-file-name {
  min-width: 0;
  flex: 1;
}

.selected-file-name strong {
  display: block;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-name small {
  display: block;
  margin-top: 1px;
  color: #6b7280;
  font-size: 9px;
  line-height: 1;
}

.selected-file-remove {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 22px;
  text-align: center;
  transition: 0.2s ease;
}

.selected-file-remove:hover {
  background: #fecaca;
}

@media (max-width: 700px) {
  .selected-file-card {
    padding: 4px 6px;
    min-height: 31px;
  }

  .selected-file-name strong {
    max-width: 180px;
  }

  .large-modal .modal-header .modal-actions {
    gap: 8px;
  }

  .large-modal .modal-header .modal-actions .btn {
    padding-left: 9px;
    padding-right: 9px;
  }

  .large-modal .modal-header .modal-close {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
}

.save-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: saveSpinnerRotate 0.7s linear infinite;
}

@keyframes saveSpinnerRotate {
  to {
    transform: rotate(360deg);
  }
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.notification-content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notification-content strong {
  font-size: 14px;
  line-height: 1.3;
}

.notification-content small {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.3;
}

.notification-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-actions .btn {
  white-space: nowrap;
  padding: 6px 9px;
  font-size: 11px;
}

.notification-policy-highlight {
  animation: notificationPolicyHighlight 2.5s ease;
}

@keyframes notificationPolicyHighlight {
  0%,
  100% {
    background: transparent;
  }

  20%,
  70% {
    background: rgba(245, 158, 11, 0.16);
  }
}

@media (max-width: 700px) {
  .notification-item {
    flex-direction: column;
  }

  .notification-actions {
    width: 100%;
  }

  .notification-actions .btn {
    flex: 1;
  }
}

/* =========================================================
   DOCUMENT PREVIEW MODAL
========================================================= */

.document-preview-modal {
  width: min(1100px, 95vw);
  max-width: 1100px;
}

.document-preview-content {
  width: 100%;
  min-height: 70vh;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #f3f4f6;

  border-radius: 10px;
  overflow: hidden;
}

.document-preview-frame {
  width: 100%;
  height: 70vh;
  min-height: 500px;

  border: 0;

  display: block;

  background: #ffffff;
}

.document-preview-image {
  display: block;

  max-width: 100%;
  max-height: 70vh;

  width: auto;
  height: auto;

  object-fit: contain;

  padding: 20px;

  box-sizing: border-box;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {
  .document-preview-modal {
    width: 96vw;
  }

  .document-preview-content {
    min-height: 65vh;
  }

  .document-preview-frame {
    height: 65vh;
    min-height: 420px;
  }

  .document-preview-image {
    max-height: 65vh;
    padding: 10px;
  }
}

/* =========================================================
   EXISTING DOCUMENTS IN EDIT POLICY
========================================================= */

.existing-files-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 5px;
  width: 100%;
}

.existing-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;

  width: 100%;
  min-height: 32px;

  padding: 4px 7px;

  border: 1px solid #dbeafe;
  border-radius: 6px;

  background: #eff6ff;

  box-sizing: border-box;
}

.existing-file-info {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 0;
  flex: 1;
}

.existing-file-icon {
  width: 27px;
  height: 27px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 6px;

  background: #ffffff;
  border: 1px solid #dbeafe;

  font-size: 13px;
}

.existing-file-name {
  min-width: 0;
  flex: 1;
}

.existing-file-name strong {
  display: block;

  font-size: 11px;
  line-height: 1.15;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.existing-file-name small {
  display: block;

  margin-top: 1px;

  color: #6b7280;

  font-size: 9px;
  line-height: 1;
}

.existing-file-actions {
  display: flex;
  align-items: center;
  gap: 4px;

  flex-shrink: 0;
}

.existing-file-view,
.existing-file-remove {
  width: 22px;
  height: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  border: 0;
  border-radius: 5px;

  cursor: pointer;

  font-size: 11px;
}

.existing-file-view {
  background: #dbeafe;
}

.existing-file-remove {
  background: #fee2e2;
  color: #dc2626;
}

.existing-file-view:hover {
  background: #bfdbfe;
}

.existing-file-remove:hover {
  background: #fecaca;
}

/* =========================================================
   MOBILE POLICY HEADING
========================================================= */

@media (max-width: 650px) {
  .policy-heading {
    top: 80px;
    padding-top: 10px;
    padding-bottom: 12px;
    margin-top: -10px;
  }

  .policy-heading .heading-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* =========================================================
   SINGLE DATE RANGE PICKER
========================================================= */

.date-range-group {
  min-width: 220px;
}

.date-range-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.date-range-input::placeholder {
  color: var(--muted);
}

.date-range-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.litepicker {
  z-index: 10000 !important;
}
