/* Cards */
.card { background: #fff; border-radius: var(--card-radius); box-shadow: var(--card-shadow); margin-bottom: 18px; overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--smoke);
}
.card-header .card-title { font-family: var(--title-font); font-size: 14px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--teal-deep); margin: 0; }
.card-header .card-title i { margin-right: 6px; color: var(--theme-color); }
.card-body { padding: 18px 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--smoke); display: flex; gap: 8px; flex-wrap: wrap; }
.card.flat { box-shadow: none; border: 1px solid var(--border); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 30px; padding: 8px 18px; font-size: 13px; font-weight: 500;
  font-family: var(--title-font); cursor: pointer; color: #fff; background: var(--teal);
  transition: transform .1s, filter .15s, box-shadow .15s; line-height: 1.2; white-space: nowrap; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 4px 12px rgba(0,0,0,.12); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-primary { background: var(--theme-color); }
.btn-teal { background: var(--teal); }
.btn-green { background: #7cb342; }
.btn-success { background: var(--green); }
.btn-danger { background: var(--red); }
.btn-blue { background: var(--blue); }
.btn-purple { background: var(--purple); }
.btn-yellow { background: var(--yellow); color: #333; }
.btn-grey { background: #8d9aa0; }
.btn-dark { background: var(--sidebar-bg); }
.btn-light { background: var(--smoke); color: var(--body-color); }
.btn-light:hover { color: var(--body-color); }
.btn-outline { background: transparent; border: 2px solid var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; }
.btn-split { padding-left: 0; }
.btn-split i { background: rgba(0,0,0,.12); height: 100%; padding: 0 12px; display: flex; align-items: center; border-radius: 30px 0 0 30px; margin-right: 2px; align-self: stretch; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.btn-tool { background: #8d9aa0; border-radius: 8px; padding: 6px 12px; font-family: var(--body-font); font-size: 12px; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.badge-green { background: #e5f6ea; color: #1e8e3e; }
.badge-red { background: #fde8ea; color: var(--red); }
.badge-orange { background: #fff1dc; color: #d9801a; }
.badge-teal { background: #e3f5f4; color: var(--teal-dark); }
.badge-blue { background: #e3f1fb; color: #1d7bc4; }
.badge-grey { background: #eef1f3; color: #5f6c72; }
.badge-dark { background: #5b6770; color: #fff; }
.badge-yellow { background: #fff6d6; color: #a0740b; }
.badge-solid-teal { background: var(--teal); color: #fff; }
.badge-solid-orange { background: var(--theme-color); color: #fff; }
.badge-solid-red { background: var(--red); color: #fff; }
.badge-solid-green { background: #7cb342; color: #fff; }
.badge-solid-blue { background: var(--blue); color: #fff; }
.badge-solid-grey { background: #8d9aa0; color: #fff; }
.pill { background: var(--smoke); border-radius: 8px; padding: 3px 10px; font-size: 12px; display: inline-block; margin: 2px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 13px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert i { margin-top: 2px; }
.alert-info { background: #e3f5f4; color: var(--teal-deep); border-left: 4px solid var(--teal); }
.alert-warning { background: #fff6d6; color: #8a6000; border-left: 4px solid var(--yellow); }
.alert-danger { background: #fde8ea; color: #a7141d; border-left: 4px solid var(--red); }
.alert-success { background: #e5f6ea; color: #1e6b33; border-left: 4px solid var(--green); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: #334; }
.form-label .req { color: var(--red); margin-left: 2px; }
.form-control, .form-select, textarea.form-control {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13px;
  font-family: var(--body-font); color: var(--body-color); background: #fff; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(30,170,164,.15); }
.form-control:disabled { background: var(--smoke); }
.form-control.is-invalid { border-color: var(--red); }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-hint.red { color: var(--red); }
.form-select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.form-select[multiple] { background-image: none; min-height: 110px; }
.form-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.col-12 { grid-column: span 12; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-8 { grid-column: span 8; } .col-9 { grid-column: span 9; } .col-2 { grid-column: span 2; }
@media (max-width: 768px) { .form-row > * { grid-column: span 12 !important; } }
.form-horizontal .form-group { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: start; }
.form-horizontal .form-label { text-align: right; padding-top: 9px; color: #667; font-weight: 400; }
@media (max-width: 768px) { .form-horizontal .form-group { grid-template-columns: 1fr; } .form-horizontal .form-label { text-align: left; padding-top: 0; } }
.form-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.form-check input { width: 16px; height: 16px; accent-color: var(--teal); }
.input-group { display: flex; }
.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .track {
  position: relative; min-width: 72px; height: 28px; border-radius: 30px; background: var(--red); color: #fff;
  font-family: var(--title-font); font-size: 12px; font-weight: 500; display: flex; align-items: center; padding: 0 10px 0 26px; transition: background .2s;
}
.toggle .track::before { content: ""; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + .track { background: var(--teal); padding: 0 26px 0 12px; }
.toggle input:checked + .track::before { left: calc(100% - 24px); }
.toggle .track .on, .toggle input:checked + .track .off { display: none; }
.toggle input:checked + .track .on { display: inline; }

/* Tags (multi select display) */
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; min-height: 40px; background: #fff; cursor: text; }
.tag-input .tag { background: var(--smoke); border-radius: 6px; padding: 3px 8px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.tag-input .tag i { cursor: pointer; opacity: .6; }
.tag-input .tag i:hover { opacity: 1; color: var(--red); }
.tag-input select { border: 0; outline: 0; flex: 1; min-width: 140px; font-family: var(--body-font); font-size: 13px; background: transparent; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th, table.table td { padding: 10px 12px; border: 1px solid #edf1f3; vertical-align: middle; }
table.table thead th { background: #fff; font-weight: 600; color: #334; text-align: left; white-space: nowrap; position: relative; }
table.table thead th.sortable { cursor: pointer; padding-right: 26px; }
table.table thead th.sortable::after { content: "\2195"; position: absolute; right: 10px; opacity: .35; font-size: 11px; }
table.table thead th.sort-asc::after { content: "\2191"; opacity: 1; color: var(--teal); }
table.table thead th.sort-desc::after { content: "\2193"; opacity: 1; color: var(--teal); }
table.table tbody tr:nth-child(odd) { background: #fbfcfd; }
table.table tbody tr:hover { background: #f1f8f8; }
table.table td.center, table.table th.center { text-align: center; }
table.table .empty { text-align: center; color: var(--muted); padding: 18px; background: #f6f8f9; }
table.table-striped-cream tbody tr:nth-child(odd) { background: #fff8ec; }

/* Datatable chrome */
.dt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dt-toolbar .dt-search { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #667; }
.dt-toolbar .dt-search input { width: 180px; padding: 6px 10px; font-size: 12px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--body-font); }
.dt-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: #667; }
.dt-footer select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--body-font); }
.dt-pagination { display: inline-flex; gap: 4px; }
.dt-pagination button { border: 1px solid var(--border); background: #fff; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-family: var(--body-font); font-size: 12px; }
.dt-pagination button.active { background: var(--theme-color); color: #fff; border-color: var(--theme-color); }
.dt-pagination button:disabled { opacity: .5; cursor: default; }
.dt-bulk { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.dt-colvis { position: relative; display: inline-block; }
.dt-colvis-menu { position: absolute; top: 110%; left: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px; z-index: 20; display: none; min-width: 180px; max-height: 260px; overflow: auto; box-shadow: var(--card-shadow); }
.dt-colvis-menu.show { display: block; }
.dt-colvis-menu label { display: block; font-size: 12px; padding: 4px 6px; cursor: pointer; }

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 160px; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 25; display: none; padding: 6px 0; text-align: left;
}
.dropdown-menu.left { right: auto; left: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; text-align: left; padding: 8px 16px; font-size: 13px; color: var(--body-color); background: none; border: 0; cursor: pointer; font-family: var(--body-font); }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--smoke); color: var(--teal-dark); }
.dropdown-menu .divider { height: 1px; background: var(--smoke); margin: 4px 0; }
.dropdown-menu .danger { color: var(--red); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,40,40,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .2s; }
.modal.lg { max-width: 900px; } .modal.sm { max-width: 420px; } .modal.xl { max-width: 1100px; }
@keyframes pop { from { transform: translateY(-10px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--smoke); }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--smoke); display: flex; justify-content: flex-end; gap: 8px; }

/* Toast */
#toast-root { position: fixed; top: 80px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--teal); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 13px; animation: slide .25s; min-width: 240px; display: flex; gap: 10px; align-items: center; }
.toast.error { background: var(--red); } .toast.warning { background: var(--theme-color); } .toast.info { background: var(--blue); }
@keyframes slide { from { transform: translateX(30px); opacity: 0 } to { transform: none; opacity: 1 } }

/* Tabs */
.tabs { display: flex; gap: 0; background: var(--smoke); border-radius: 14px; overflow: hidden; margin-bottom: 18px; flex-wrap: wrap; }
.tabs .tab { flex: 1; text-align: center; padding: 12px 10px; font-family: var(--title-font); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #667; cursor: pointer; min-width: 120px; transition: background .15s; }
.tabs .tab:hover { background: #e4edf0; }
.tabs .tab.active { background: var(--theme-color); color: #fff; }
.tabs.tabs-teal .tab.active { background: var(--teal); }
.tab-pane { display: none; } .tab-pane.active { display: block; }
.tabs-nav { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs-nav .tab { padding: 8px 16px; font-size: 13px; cursor: pointer; border-radius: 8px 8px 0 0; }
.tabs-nav .tab.active { background: var(--theme-color); color: #fff; }

/* Accordion sections (form) */
.acc-section { border: 1px solid var(--smoke); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.acc-section > .acc-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-family: var(--title-font); font-weight: 500; font-size: 14px; cursor: pointer; border-left: 4px solid var(--teal); background: #f4fbfb; }
.acc-section.blue > .acc-head { border-color: var(--blue); background: #f0f7fd; color: #1a6fb1; }
.acc-section.teal > .acc-head { border-color: var(--teal); background: #eef9f8; color: var(--teal-deep); }
.acc-section.orange > .acc-head { border-color: var(--theme-color); background: #fff7ea; color: #b56f10; }
.acc-section.purple > .acc-head { border-color: var(--purple); background: #f5f1fc; color: #5e3fa6; }
.acc-section.grey > .acc-head { border-color: #8d9aa0; background: #f4f6f7; color: #4a5a63; }
.acc-section.red > .acc-head { border-color: var(--red); background: #fdf0f1; color: #a7141d; }
.acc-section > .acc-body { padding: 18px; display: block; }
.acc-section.collapsed > .acc-body { display: none; }
.acc-section .acc-head .chev { transition: transform .2s; font-size: 11px; }
.acc-section.collapsed .acc-head .chev { transform: rotate(-90deg); }

/* Tiles (report buttons) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tile { display: flex; align-items: stretch; border-radius: 16px; overflow: hidden; color: #fff; font-family: var(--title-font); font-weight: 600; font-size: 17px; cursor: pointer; min-height: 68px; transition: transform .12s, box-shadow .15s; text-decoration: none; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.15); color: #fff; }
.tile .tile-icon { width: 64px; display: grid; place-items: center; background: rgba(0,0,0,.18); font-size: 24px; flex-shrink: 0; }
.tile .tile-label { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-card .stat-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 22px; flex-shrink: 0; }
.stat-card .stat-value { font-family: var(--title-font); font-size: 26px; font-weight: 600; color: var(--title-color); line-height: 1; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Avatar */
.avatar-circle { width: 34px; height: 34px; border-radius: 50%; background: var(--smoke); display: inline-grid; place-items: center; color: var(--teal-dark); font-weight: 600; }
.avatar-lg { width: 130px; height: 130px; border-radius: 50%; background: linear-gradient(135deg, var(--teal) 0%, var(--theme-color) 100%); display: grid; place-items: center; color: #fff; font-family: var(--title-font); font-size: 44px; font-weight: 600; border: 6px solid #fff; box-shadow: var(--card-shadow); }

/* Page header */
.page-title-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-title-bar h2 { font-size: 20px; margin: 0; }

/* Filter panel */
.filter-panel { background: #fff; border-radius: var(--card-radius); box-shadow: var(--card-shadow); margin-bottom: 18px; }
.filter-panel .fp-head { padding: 12px 20px; font-family: var(--title-font); font-weight: 600; font-size: 13px; text-transform: uppercase; color: var(--teal-deep); border-bottom: 1px solid var(--smoke); }
.filter-panel .fp-body { padding: 16px 20px; }
.filter-panel .fp-foot { padding: 10px 20px 14px; display: flex; justify-content: flex-end; gap: 8px; background: var(--light); }

/* Progress */
.progress { height: 8px; border-radius: 10px; background: var(--smoke); overflow: hidden; display: flex; }
.progress span { height: 100%; }

/* Icon color helpers */
.bg-teal { background: var(--teal); } .bg-orange { background: var(--theme-color); } .bg-red { background: var(--red); } .bg-green { background: #7cb342; }
.bg-blue { background: var(--blue); } .bg-purple { background: var(--purple); } .bg-pink { background: var(--pink); } .bg-yellow { background: var(--yellow); }
.bg-grey { background: #8d9aa0; } .bg-brown { background: #a07a60; } .bg-tan { background: #d2b48c; } .bg-lime { background: #c0ca33; } .bg-sky { background: #90caf9; } .bg-navy { background: #5c7a99; }

/* Info list rows (profile) */
.info-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); background: var(--smoke); }
.info-strip div { padding: 12px; text-align: center; border-right: 1px solid #fff; font-size: 13px; }
.info-strip div b { display: block; font-family: var(--title-font); color: var(--title-color); }

/* Misc */
.divider { height: 1px; background: var(--smoke); margin: 14px 0; }
.kbd { background: var(--smoke); border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--smoke); }
.timeline li { position: relative; padding: 0 0 18px 16px; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--teal); }
.timeline li h5 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; }
.timeline li h5 small { color: var(--muted); font-family: var(--body-font); font-weight: 400; }
.timeline li ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: #556; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state i { font-size: 42px; color: #cfd8dc; margin-bottom: 10px; display: block; }
