/* AFIDFF EDMS — Stylesheet */
:root {
  --coral: #D85A30;
  --coral-lt: #FAECE7;
  --coral-dk: #712B13;
  --teal: #1D9E75;
  --teal-lt: #E1F5EE;
  --teal-dk: #085041;
  --amber: #BA7517;
  --amber-lt: #FAEEDA;
  --amber-dk: #633806;
  --blue: #185FA5;
  --blue-lt: #E6F1FB;
  --blue-dk: #0C447C;
  --green: #3B6D11;
  --green-lt: #EAF3DE;
  --green-dk: #27500A;
  --red: #A32D2D;
  --red-lt: #FCEBEB;
  --red-dk: #791F1F;
  --purple: #534AB7;
  --purple-lt: #EEEDFE;
  --purple-dk: #3C3489;
  --gray-lt: #F1EFE8;
  --gray-dk: #444441;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f5f5f3;
  min-height: 100vh;
}

/* ---- LOGIN ---- */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-lt);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: min(420px, 95vw);
  border: 0.5px solid rgba(0,0,0,0.1);
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--coral); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.login-title { font-size: 18px; font-weight: 600; color: #1a1a1a; }
.login-sub { font-size: 12px; color: #666; margin-top: 2px; }
.login-error {
  background: var(--red-lt); color: var(--red-dk);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.login-card label { font-size: 12px; color: #555; display: block; margin-bottom: 4px; }
.login-card input {
  width: 100%; border: 1px solid #ddd; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; margin-bottom: 14px;
  outline: none; transition: border-color .2s;
}
.login-card input:focus { border-color: var(--coral); }
.btn-login {
  width: 100%; background: var(--coral); color: #fff;
  border: none; border-radius: 8px; padding: 11px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover { opacity: .9; }

/* ---- TOPBAR ---- */
.topbar {
  background: var(--coral); color: #fff;
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-sub { font-size: 11px; opacity: .8; margin-top: 1px; }
.clock-display {
  background: rgba(255,255,255,.18);
  padding: 4px 10px; border-radius: 6px; text-align: right;
}
.clock-display .time { font-size: 17px; font-weight: 500; display: block; }
.clock-display span:last-child { font-size: 10px; opacity: .85; }
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15);
  padding: 5px 10px; border-radius: 8px; font-size: 13px;
}
.user-badge button {
  background: none; border: none; color: #fff;
  cursor: pointer; padding: 0; font-size: 16px; line-height: 1;
}
.user-badge button:hover { opacity: .7; }

/* ---- NAV ---- */
.nav {
  display: flex; background: #fff;
  border-bottom: 1px solid #e5e5e5;
  overflow-x: auto; gap: 2px; padding: 0 12px;
  position: sticky; top: 53px; z-index: 40;
}
.nav button {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 12px; font-size: 13px; color: #666;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.nav button.active { color: var(--coral); border-bottom-color: var(--coral); font-weight: 500; }
.nav button i { font-size: 15px; }
.notif-dot {
  width: 7px; height: 7px; background: var(--red);
  border-radius: 50%; display: inline-block; margin-left: 3px;
}

/* ---- CONTENT ---- */
.content { padding: 16px 20px; max-width: 1200px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }

/* ---- LOADING ---- */
.loading-bar {
  text-align: center; padding: 24px;
  color: #666; font-size: 13px;
}
.loading-spinner i { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- CARDS ---- */
.card {
  background: #fff; border: 0.5px solid rgba(0,0,0,.1);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
}
.card.p0 { padding: 0; overflow: hidden; }
.card h3 {
  font-size: 11px; font-weight: 500; color: #888;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
}

/* ---- GRIDS ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.mb { margin-bottom: 12px; }

/* ---- METRICS ---- */
.metric {
  background: #f8f8f6; border-radius: 8px; padding: 12px; text-align: center;
}
.metric .val { font-size: 22px; font-weight: 600; color: #1a1a1a; }
.metric .lbl { font-size: 11px; color: #888; margin-top: 2px; }

/* ---- BUTTONS ---- */
.btn {
  background: none; border: 0.5px solid rgba(0,0,0,.2);
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; color: #1a1a1a;
}
.btn:hover { background: #f5f5f3; }
.btn.primary { background: var(--coral); color: #fff; border-color: var(--coral); }
.btn.primary:hover { opacity: .9; }
.btn.sm { font-size: 12px; padding: 5px 10px; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- FORMS ---- */
input, select, textarea {
  width: 100%; border: 0.5px solid rgba(0,0,0,.2);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
  background: #fff; color: #1a1a1a; margin-bottom: 8px;
  outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--coral); }
textarea { min-height: 64px; resize: vertical; }
label { font-size: 12px; color: #666; display: block; margin-bottom: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 9px 12px;
  font-size: 11px; font-weight: 500; color: #888;
  border-bottom: 0.5px solid rgba(0,0,0,.1);
  text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
td {
  padding: 9px 12px; border-bottom: 0.5px solid rgba(0,0,0,.06);
  color: #1a1a1a; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaf8; }

/* ---- BADGES ---- */
.badge {
  display: inline-block; font-size: 11px;
  padding: 2px 8px; border-radius: 20px; font-weight: 500; white-space: nowrap;
}
.b-active, .b-approved, .b-completed, .b-paid, .b-good { background: var(--teal-lt); color: var(--teal-dk); }
.b-pending, .b-inprogress, .b-partial, .b-leave { background: var(--amber-lt); color: var(--amber-dk); }
.b-inactive, .b-notstarted, .b-draft { background: var(--gray-lt); color: var(--gray-dk); }
.b-rejected, .b-overdue, .b-critical { background: var(--red-lt); color: var(--red-dk); }
.b-planning, .b-info, .b-doc { background: var(--blue-lt); color: var(--blue-dk); }
.b-festival, .b-screening { background: var(--purple-lt); color: var(--purple-dk); }
.b-asset { background: var(--green-lt); color: var(--green-dk); }

/* ---- MODALS ---- */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 100;
  align-items: center; justify-content: center;
  overflow-y: auto; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 22px;
  width: min(520px, 96vw); max-height: 90vh;
  overflow-y: auto; margin: auto;
}
.modal h2 {
  font-size: 15px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px; padding-top: 14px;
  border-top: 0.5px solid rgba(0,0,0,.1);
}

/* ---- CLOCK ---- */
.clock-center { text-align: center; padding: 20px 0 10px; }
.big-clock { font-size: 52px; font-weight: 600; color: var(--coral); letter-spacing: -1px; }
.big-date { font-size: 14px; color: #888; margin-bottom: 20px; }
.clock-status { font-size: 14px; color: #666; margin-bottom: 16px; }
.clock-btns { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; }

/* ---- PROGRESS ---- */
.progress-bar {
  height: 6px; background: #eee; border-radius: 3px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--teal); border-radius: 3px; }

/* ---- PAYSLIP ---- */
.payslip-preview {
  background: #f8f8f6; border-radius: 8px; padding: 12px; margin-bottom: 10px;
}
.ps-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 13px;
  border-bottom: 0.5px dotted #ddd;
}
.ps-row:last-child { border-bottom: none; }
.ps-row.net { font-weight: 600; font-size: 14px; border-top: 1px solid #ddd; margin-top: 4px; padding-top: 8px; }
.ps-row.net span:last-child { color: var(--teal); }

/* ---- KANBAN ---- */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kanban-col {
  background: #f5f5f3; border-radius: 12px; padding: 10px; min-height: 120px;
}
.kanban-col h4 {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .5px; color: #888; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.kanban-card {
  background: #fff; border: 0.5px solid rgba(0,0,0,.1);
  border-radius: 8px; padding: 9px 11px; margin-bottom: 6px;
  cursor: pointer; transition: border-color .15s;
}
.kanban-card:hover { border-color: var(--coral); }
.kanban-card .kc-title { font-weight: 500; font-size: 13px; margin-bottom: 4px; }
.kanban-card .kc-meta { font-size: 11px; color: #888; }

/* ---- SEARCH ---- */
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input, .search-bar select { margin-bottom: 0; }

/* ---- SECTION HEADER ---- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h2 { font-size: 16px; font-weight: 600; }
.date-label { font-size: 12px; color: #888; }

/* ---- EMPTY ---- */
.empty { text-align: center; padding: 28px; color: #aaa; font-size: 13px; }
.empty i { font-size: 28px; display: block; margin-bottom: 8px; opacity: .4; }

/* ---- STARS ---- */
.star { font-size: 24px; cursor: pointer; color: #ddd; transition: color .1s; }
.star.on { color: var(--amber); }

/* ---- NOTIFICATIONS ---- */
.notif-item {
  padding: 12px 16px; border-bottom: 0.5px solid rgba(0,0,0,.06);
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #fffdf9; }
.notif-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

/* ---- DOCS ---- */
.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 0.5px solid rgba(0,0,0,.1);
  border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.doc-icon {
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.doc-meta { flex: 1; min-width: 0; }
.doc-meta .dtitle { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta .dsub { font-size: 11px; color: #888; margin-top: 2px; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: #333; color: #fff;
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  z-index: 200; transform: translateY(80px);
  transition: transform .25s; pointer-events: none;
}
.toast.show { transform: translateY(0); }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar-sub { display: none; }
  .user-badge span { display: none; }
  .content { padding: 12px; }
}
