/* ==================================================
   ROMAC ATTENDANCE — CORPORATE BRAND DESIGN
   Brand: Purple / Charcoal / Coral Red / White
   ================================================== */

:root {
  --purple: #49317F;
  --purple-dark: #302052;
  --purple-light: #F1ECF9;
  --coral: #E64B58;
  --coral-light: #FFF0F1;
  --charcoal: #45434D;
  --muted: #777482;
  --background: #F6F5F9;
  --white: #FFFFFF;
  --border: #E7E3EE;
  --success: #26734D;
  --success-bg: #EAF6EF;
  --danger: #B83240;
  --danger-bg: #FFF0F1;
  --shadow: 0 8px 28px rgba(48,32,82,.07);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--charcoal);
  background: var(--background);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--charcoal);
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: var(--purple);
  transition: color .2s ease, background .2s ease;
}

a:hover {
  color: var(--coral);
}

/* TOP NAVIGATION */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  min-height: 76px;
  padding: 13px clamp(16px, 4vw, 52px);
  color: var(--white);
  background: linear-gradient(110deg, var(--purple-dark), var(--purple));
  box-shadow: 0 5px 24px rgba(48,32,82,.17);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: var(--white);
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .4px;
}

.brand:hover {
  color: var(--white);
}

.brand small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: .78;
}

.brand-logo {
  display: block;
  width: 49px;
  height: 49px;
  flex-shrink: 0;
  padding: 3px;
  object-fit: contain;
  background: var(--white);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: auto;
  color: var(--white);
  background: var(--purple);
  border-radius: 16px;
  font-size: 30px;
  font-weight: 900;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  margin: 0;
  color: var(--purple);
  background: var(--white);
  border-radius: 10px;
  font-size: 22px;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

nav a {
  padding: 9px 12px;
  color: rgba(255,255,255,.91);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
}

nav a:hover,
nav a:focus-visible {
  color: var(--white);
  background: rgba(255,255,255,.14);
}

.inline-logout {
  display: inline-flex;
  margin: 0;
}

.logout {
  color: var(--white);
  background: transparent;
  border-color: rgba(255,255,255,.42);
}

/* MAIN PAGE */

.container {
  width: min(1240px, 94%);
  margin: 34px auto 50px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 25px;
}

.page-head h1 {
  margin: 0 0 5px;
  color: var(--purple-dark);
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 750;
  letter-spacing: -.6px;
  line-height: 1.3;
}

.muted {
  margin: 0;
  color: var(--muted);
}

/* DASHBOARD CARDS */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 24px;
}

.stat,
.panel,
.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 23px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--purple);
  content: "";
}

.stat:nth-child(2)::before {
  background: var(--coral);
}

.stat:nth-child(3)::before {
  background: var(--charcoal);
}

.stat:nth-child(4)::before {
  background: #9279C4;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(48,32,82,.11);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

.stat strong {
  display: block;
  margin-top: 9px;
  color: var(--purple-dark);
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* PANELS AND QUICK LINKS */

.panel {
  margin: 0 0 22px;
  padding: 25px;
}

.panel h2 {
  margin: 0 0 19px;
  color: var(--purple-dark);
  font-size: 19px;
  font-weight: 750;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 20px;
  color: var(--charcoal);
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color .2s, background .2s, transform .2s;
}

.quick:hover {
  color: var(--purple-dark);
  background: #FAF8FF;
  border-color: #B9A9DB;
  transform: translateY(-2px);
}

.quick small {
  color: var(--muted);
}

/* LOGIN SCREEN */

.login-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px 18px;
  background:
    radial-gradient(ellipse at 10% 12%, rgba(73,49,127,.12), transparent 38%),
    radial-gradient(ellipse at 90% 90%, rgba(230,75,88,.08), transparent 34%),
    var(--background);
}

.login-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 38px 36px;
  text-align: center;
  border-radius: 22px;
  box-shadow: 0 22px 65px rgba(48,32,82,.12);
}

.login-logo {
  display: block;
  width: 150px;
  height: 150px;
  max-width: 100%;
  margin: 0 auto 20px;
  object-fit: contain;
  object-position: center;
}

.login-card h1 {
  margin: 12px 0 7px;
  color: var(--purple-dark);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.login-card > p {
  margin: 0 0 26px;
  color: var(--muted);
  text-align: center;
}

/* FORMS */

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 650;
  text-align: start;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  color: #292633;
  background: var(--white);
  border: 1px solid #DCD7E7;
  border-radius: 9px;
  outline: none;
  font: inherit;
  transition: border-color .18s, box-shadow .18s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(73,49,127,.12);
}

input::placeholder,
textarea::placeholder {
  color: #A29CAB;
}

button {
  padding: 11px 16px;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid #DCD7E7;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s;
}

button:hover {
  filter: brightness(.98);
}

button.primary {
  color: var(--white);
  background: var(--purple);
  border-color: var(--purple);
}

button.primary:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
  transform: translateY(-1px);
}

.full {
  width: 100%;
  margin-top: 5px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 17px;
}

.form-action {
  display: flex;
  align-items: center;
  padding-bottom: 15px;
}

/* TABLES */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 14px;
}

th {
  color: var(--purple-dark);
  background: #F2EEF9;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .025em;
}

td,
th {
  padding: 13px 14px;
  border-bottom: 1px solid #EEEAF3;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #FBFAFD;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

tfoot th {
  background: var(--purple-light);
}

.ot-input {
  width: 100px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 19px;
}

.filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 13px;
  margin-bottom: 20px;
}

.filters label {
  min-width: 180px;
  margin: 0;
}

.filters button {
  min-height: 43px;
}

/* ALERTS AND MESSAGES */

.alert {
  margin: 0 0 17px;
  padding: 13px 15px;
  border-radius: 10px;
  font-size: 14px;
}

.alert.success {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #D3EBDD;
}

.alert.error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #F5D6D9;
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.note {
  margin: 14px 2px;
  font-size: 12px;
}

.footer {
  padding: 24px;
  color: #898492;
  font-size: 12px;
  text-align: center;
}

/* ARABIC AND RIGHT-TO-LEFT SUPPORT */

html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .topbar,
html[dir="rtl"] nav,
html[dir="rtl"] .page-head,
html[dir="rtl"] .filters {
  direction: rtl;
}

html[dir="rtl"] th {
  text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  text-align: right;
}

html[dir="rtl"] .stat::before {
  right: 0;
  left: auto;
}

/* RESPONSIVE LAYOUT */

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 15px 18px;
  }

  nav {
    width: 100%;
    gap: 3px;
  }

  nav a {
    padding: 8px 9px;
    font-size: 12px;
  }

  .container {
    width: 94%;
    margin: 23px auto 35px;
  }

  .page-head h1 {
    font-size: 25px;
  }

  .stats {
    gap: 11px;
  }

  .stat {
    padding: 16px;
  }

  .stat strong {
    font-size: 25px;
  }

  .panel {
    padding: 17px;
  }

  .quick-links,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 27px 21px;
  }

  .login-logo {
    width: 125px;
    height: 125px;
  }

  .brand-logo {
    width: 43px;
    height: 43px;
  }

  .filters label {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* END ROMAC ATTENDANCE DESIGN */
