/* Visual refresh: STIE Nasional academic attendance portal */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-light: #eaf2ff;
  --primary-subtle: #dbeafe;
  --primary-glow: rgba(37, 99, 235, 0.2);
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --primary-gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --bg-page: #f3f6fc;
  --bg-canvas: #ffffff;
  --card-bg: #ffffff;
  --card-elevated: #ffffff;
  --card-border: #e7edf6;
  --border: #e7edf6;
  --border-focus: #2563eb;
  --sidebar-bg: #101b32;
  --sidebar-border: #24324b;
  --sidebar-text: #b5c2d8;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: rgba(75, 132, 255, 0.18);
  --sidebar-active-text: #ffffff;
  --text-main: #15233b;
  --text-secondary: #40516d;
  --text-muted: #71809a;
  --text-subtle: #9aa7bb;
  --input-bg: #ffffff;
  --input-border: #dbe3ef;
  --surface-subtle: #f5f8fd;
  --table-header-bg: #f5f8fd;
  --table-hover-bg: #f7faff;
  --grid-line-color: rgba(255, 255, 255, 0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 21px;
  --radius-xl: 28px;
  --shadow-xs: 0 2px 8px rgba(22, 42, 76, 0.04);
  --shadow-sm: 0 6px 18px rgba(22, 42, 76, 0.06);
  --shadow-md: 0 14px 36px rgba(22, 42, 76, 0.09);
  --shadow-lg: 0 22px 50px rgba(22, 42, 76, 0.12);
  --shadow-xl: 0 28px 70px rgba(22, 42, 76, 0.18);
}

[data-theme="dark"] {
  --bg-page: #080f1d;
  --bg-canvas: #0d1728;
  --card-bg: #111e33;
  --card-elevated: #172640;
  --card-border: #22324b;
  --border: #22324b;
  --border-focus: #7aa7ff;
  --sidebar-bg: #080f1d;
  --sidebar-border: #1e2c42;
  --sidebar-text: #a9b7cc;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: rgba(75, 132, 255, 0.2);
  --sidebar-active-text: #ffffff;
  --text-main: #f2f6fc;
  --text-secondary: #d0daea;
  --text-muted: #a3b1c6;
  --text-subtle: #74839a;
  --input-bg: #101d31;
  --input-border: #2b3d59;
  --surface-subtle: #16243a;
  --table-header-bg: #172640;
  --table-hover-bg: #192944;
  --grid-line-color: rgba(255, 255, 255, 0.055);
  --primary-light: rgba(59, 130, 246, 0.18);
  --primary-subtle: rgba(59, 130, 246, 0.25);
  --success-light: rgba(16, 185, 129, 0.16);
  --success-text: #6ee7b7;
  --success-border: rgba(16, 185, 129, 0.32);
  --warning-light: rgba(245, 158, 11, 0.16);
  --warning-text: #fcd34d;
  --warning-border: rgba(245, 158, 11, 0.34);
  --danger-light: rgba(239, 68, 68, 0.16);
  --danger-text: #fda4af;
  --danger-border: rgba(239, 68, 68, 0.34);
}

body {
  background:
    radial-gradient(ellipse at 8% 0%, rgba(71, 123, 237, 0.09), transparent 32rem),
    radial-gradient(ellipse at 95% 12%, rgba(16, 185, 129, 0.07), transparent 28rem),
    var(--bg-page);
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
.radio-card-label,
.stat-card-prodify,
.project-item {
  -webkit-tap-highlight-color: transparent;
}

.main-wrapper {
  max-width: 1120px;
  margin-top: 2.25rem;
}

.form-hero-card,
.login-card,
.admin-content,
.bento-card,
.card-table-wrapper,
.modal-content-card {
  border-color: var(--card-border);
  box-shadow: var(--shadow-md);
}

.form-hero-card {
  border-radius: 30px;
}

.form-header-banner {
  min-height: 224px;
  padding: 2.6rem 2.75rem;
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 86% 15%, rgba(93, 255, 213, 0.21), transparent 12rem),
    radial-gradient(circle at 98% 105%, rgba(73, 110, 255, 0.58), transparent 22rem),
    linear-gradient(120deg, #101d3a 0%, #183a73 57%, #2459bb 100%);
}

.form-header-banner::before {
  opacity: 0.6;
  background-size: 40px 40px;
}

.form-header-banner::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  bottom: -165px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(255, 255, 255, 0.035), 0 0 0 52px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.form-header-content {
  gap: 1.5rem !important;
}

.form-header-title {
  margin-top: 0.75rem;
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  color: #fff;
}

.form-header-desc {
  max-width: 590px;
  color: rgba(239, 246, 255, 0.82);
}

.form-header-banner .badge-tag {
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.form-header-banner .theme-toggle-banner {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.form-header-banner .theme-toggle-banner:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.form-body {
  padding: 2.3rem 2.75rem 2.5rem;
}

.form-section-divider {
  padding: 0.2rem 0 0.75rem;
  margin-top: 0.8rem;
  border-color: var(--border);
  color: var(--text-main);
  font-size: 0.94rem;
  letter-spacing: 0;
}

.form-section-divider i {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #2563eb;
  background: var(--primary-light);
  border-radius: 10px;
}

.form-grid {
  gap: 1.3rem 1.5rem;
}

.form-label {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.form-label > i {
  color: #6480a8;
}

.form-control,
.table-search-input,
.table-select-filter {
  min-height: 48px;
  border-color: var(--input-border);
  border-radius: 12px;
  background-color: var(--input-bg);
  box-shadow: none;
}

.form-control:hover,
.table-search-input:hover,
.table-select-filter:hover {
  border-color: #aabbd3;
}

.input-icon-wrapper > i:first-child {
  left: 1rem;
}

.form-control:focus,
.table-search-input:focus,
.table-select-filter:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.radio-card-label {
  min-height: 80px;
  border-color: var(--border);
  border-radius: 15px;
}

.radio-card-label.selected {
  border-color: #3981f6;
  background: var(--primary-light);
}

.form-actions {
  margin-top: 2rem;
}

.auth-notice-banner,
.auth-success-banner {
  margin-left: 2.75rem;
  margin-right: 2.75rem;
  border-radius: 15px;
}

.auth-notice-banner {
  background: var(--primary-light);
  border-color: var(--primary-subtle);
}

.auth-success-banner {
  background: var(--success-light);
  border-color: var(--success-border);
}

.btn {
  min-height: 42px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.btn-sm {
  min-height: 36px;
  border-radius: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #2874f0, #4e59df);
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-success {
  background: linear-gradient(135deg, #0da879, #0b8b76);
}

.btn-danger:hover {
  background-color: #e5484d;
}

#view-login.active {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(80, 143, 255, 0.3), transparent 28rem),
    radial-gradient(ellipse at 85% 88%, rgba(13, 185, 160, 0.2), transparent 27rem),
    linear-gradient(145deg, #0b1428, #132b51 62%, #15345a);
}

#view-login.active::before,
#view-login.active::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  pointer-events: none;
}

#view-login.active::before {
  top: -250px;
  left: -160px;
  box-shadow: 0 0 0 35px rgba(255, 255, 255, 0.025), 0 0 0 70px rgba(255, 255, 255, 0.02);
}

#view-login.active::after {
  right: -260px;
  bottom: -260px;
  box-shadow: 0 0 0 35px rgba(255, 255, 255, 0.025), 0 0 0 70px rgba(255, 255, 255, 0.02);
}

.login-container {
  max-width: 460px;
}

.login-card {
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
}

.login-header {
  padding: 2rem 2rem 1.45rem;
  background: linear-gradient(180deg, var(--card-bg), var(--surface-subtle));
}

.login-header-logo {
  width: 84px;
  margin-bottom: 1rem;
}

.login-header-tag {
  color: #2457b6;
  background: #eaf2ff;
  border-color: #d7e5ff;
}

.login-header h1 {
  font-size: 1.3rem;
  letter-spacing: -0.035em;
}

.login-subtitle {
  color: #2869d7;
}

.login-clock-badge {
  margin-top: 0.8rem;
}

.login-body {
  padding: 1.8rem 2rem 2rem;
  gap: 1.15rem;
}

.login-feature-chips {
  flex-wrap: wrap;
  row-gap: 0.45rem;
}

.theme-toggle-login-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.theme-toggle-login-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.19);
}

#view-login footer,
.main-wrapper > footer,
.admin-content > footer {
  color: rgba(226, 234, 247, 0.75) !important;
}

.main-wrapper > footer div,
.admin-content > footer div {
  color: inherit !important;
}

.admin-layout {
  min-height: 100vh;
  gap: 1rem;
  padding: 1rem;
  background: transparent;
}

.admin-sidebar {
  width: 260px;
  top: 1rem;
  height: calc(100vh - 2rem);
  border-radius: 22px;
  border-color: var(--sidebar-border);
  background:
    radial-gradient(circle at 5% 0%, rgba(59, 130, 246, 0.16), transparent 15rem),
    var(--sidebar-bg);
  box-shadow: 0 18px 48px rgba(8, 18, 37, 0.18);
}

.sidebar-header {
  padding: 1.45rem 1.1rem 1.15rem;
  border-color: var(--sidebar-border);
}

.sidebar-user {
  padding: 0.45rem 0.25rem;
}

.sidebar-user:hover,
.admin-sidebar .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
}

.admin-sidebar #admin-user-display-name {
  color: #f3f7ff !important;
}

.admin-sidebar #admin-user-display-role {
  color: #6ee7b7 !important;
}

.sidebar-avatar {
  background: linear-gradient(145deg, #3988ff, #6658e8);
  box-shadow: 0 7px 18px rgba(55, 114, 239, 0.35);
}

.sidebar-nav {
  padding: 1rem 0.7rem;
  gap: 0.35rem;
}

.nav-section-title {
  padding-top: 1.1rem;
  color: #8092ad;
}

.admin-sidebar .sidebar-link {
  min-height: 44px;
  border-radius: 12px;
  color: var(--sidebar-text);
}

.admin-sidebar .sidebar-link i {
  color: #8ea2c0;
}

.admin-sidebar .sidebar-link.active {
  background: linear-gradient(100deg, rgba(61, 126, 246, 0.29), rgba(61, 126, 246, 0.11));
  box-shadow: inset 3px 0 #58a0ff;
  color: #fff;
}

.admin-sidebar .sidebar-link.active i,
.admin-sidebar .sidebar-link:hover i {
  color: #78b1ff;
}

.admin-sidebar #sidebar-link-form-absen {
  color: #82b7ff !important;
}

.sidebar-prodify-card {
  margin: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(110, 231, 183, 0.32), transparent 9rem),
    linear-gradient(140deg, #246be0, #3446b9 75%, #4638a3);
}

.sidebar-footer {
  border-color: var(--sidebar-border);
}

.sidebar-footer > div {
  color: #90a0b8 !important;
}

.admin-content {
  padding: 1.4rem 1.65rem;
  border-radius: 22px;
  background: var(--bg-canvas);
  box-shadow: var(--shadow-sm);
}

.admin-topbar-nav {
  min-height: 66px;
  margin-bottom: 1.4rem;
  padding: 0.7rem 1rem;
  border-radius: 15px;
  background: var(--card-bg);
}

.admin-topbar-nav > div:first-child > span {
  letter-spacing: -0.025em;
}

.mobile-sidebar-toggle {
  min-width: 42px;
  min-height: 42px;
  border-radius: 11px;
}

.dash-hero-banner {
  min-height: 250px;
  margin-bottom: 1.35rem;
  padding: 2rem 2.15rem;
  border: 0;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(68, 229, 195, 0.28), transparent 13rem),
    radial-gradient(circle at 100% 110%, rgba(91, 100, 255, 0.8), transparent 25rem),
    linear-gradient(115deg, #142448 0%, #1a4685 58%, #266bcc 100%);
  box-shadow: 0 18px 38px rgba(32, 83, 164, 0.22);
}

.dash-hero-grid-pattern {
  opacity: 0.6;
  background-size: 38px 38px;
}

.dash-hero-banner::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -65px;
  top: -155px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.035), 0 0 0 56px rgba(255, 255, 255, 0.025);
}

.dash-hero-content {
  max-width: 800px;
}

.dash-date-pill {
  color: #e2efff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.2);
}

.dash-hero-title {
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.dash-hero-subtitle {
  color: #c5f9eb;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 1rem;
  font-weight: 500;
  margin: 0.35rem 0 1.45rem;
}

.dash-hero-actions {
  gap: 0.55rem;
}

.dash-hero-actions .btn-primary {
  color: #17305a;
  border-color: rgba(255, 255, 255, 0.7);
  background: #b9f5df;
  box-shadow: 0 8px 20px rgba(4, 19, 47, 0.15);
}

.dash-hero-actions .btn-primary:hover {
  background: #d4ffef;
}

.dash-hero-actions .btn-secondary {
  color: #f2f7ff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.dash-hero-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.35rem;
}

.stat-card-prodify {
  min-height: 132px;
  padding: 1.1rem;
  border-radius: 17px;
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.stat-card-prodify:nth-child(1) { border-top: 3px solid #4e82ed; }
.stat-card-prodify:nth-child(2) { border-top: 3px solid #16b889; }
.stat-card-prodify:nth-child(3) { border-top: 3px solid #9b70ed; }
.stat-card-prodify:nth-child(4) { border-top: 3px solid #f2a63b; }

.stat-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.stat-value {
  font-size: 1.75rem;
  color: var(--text-main);
}

.bento-card,
.card-table-wrapper {
  border-radius: 18px;
}

.bento-header,
.table-toolbar {
  padding: 1.1rem 1.3rem;
}

.bento-title {
  font-size: 1rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.15rem 0 1.15rem;
}

.page-title {
  color: var(--text-main);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.table-search-input {
  height: 42px;
  min-height: 42px;
  width: 265px;
}

.table-search-input:focus {
  width: 285px;
}

.table-select-filter {
  min-height: 42px;
  padding: 0.5rem 0.8rem;
}

.modern-table {
  min-width: 760px;
}

.modern-table th {
  padding: 0.9rem 1rem;
  color: #6e7e98;
  border-bottom-width: 1px;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
}

.modern-table td {
  padding: 0.9rem 1rem;
  color: var(--text-secondary);
}

.modern-table tbody tr:hover td {
  background: var(--table-hover-bg);
}

.badge-pill,
.badge-status {
  letter-spacing: 0;
}

.modal-backdrop {
  background: rgba(6, 16, 33, 0.7);
}

.modal-content-card {
  border-radius: 22px;
}

.modal-header-bar,
.modal-toolbar {
  padding: 1rem 1.25rem;
}

.empty-state {
  color: var(--text-muted);
}

.empty-state i {
  color: #a9b8cc;
}

.sidebar-backdrop {
  background: rgba(5, 13, 28, 0.62);
}

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

@media (max-width: 992px) {
  .admin-layout {
    padding: 0.65rem;
  }

  .admin-sidebar {
    top: 0;
    left: 0;
    height: 100vh;
    border-radius: 0 22px 22px 0;
  }

  .admin-content {
    padding: 1.1rem;
  }

  .form-header-banner {
    padding: 2rem 1.6rem;
  }

  .form-body {
    padding: 1.8rem 1.6rem 2rem;
  }

  .auth-notice-banner,
  .auth-success-banner {
    margin-left: 1.6rem;
    margin-right: 1.6rem;
  }
}

@media (max-width: 768px) {
  .main-wrapper {
    margin-top: 0.75rem;
  }

  .form-header-content > div:last-child {
    align-items: flex-start !important;
  }

  .form-header-banner {
    min-height: auto;
    padding: 1.55rem 1.25rem;
  }

  .form-header-title {
    font-size: 1.8rem;
  }

  .form-body {
    padding: 1.35rem 1.25rem 1.6rem;
  }

  .auth-notice-banner,
  .auth-success-banner {
    margin-left: 1.1rem;
    margin-right: 1.1rem;
    padding: 0.95rem;
  }

  .stats-grid {
    gap: 0.7rem;
  }

  .stat-card-prodify {
    min-height: 116px;
    padding: 0.9rem;
    gap: 0.75rem;
  }

  .stat-icon-wrapper {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .dash-hero-banner {
    min-height: auto;
    padding: 1.55rem 1.3rem;
    border-radius: 19px;
  }

  .dash-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dash-hero-actions .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .admin-topbar-nav {
    flex-direction: row;
    align-items: center;
    padding: 0.65rem;
  }

  .admin-topbar-nav > div:last-child {
    gap: 0.35rem !important;
  }

  .admin-topbar-nav > div:last-child .btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
  }

  .table-toolbar {
    padding: 0.9rem;
  }

  .filter-group-wrap {
    grid-template-columns: 1fr 1fr;
  }

  .table-search-input {
    width: 100%;
  }

  .page-header {
    align-items: flex-start;
  }

  .page-header > div:last-child {
    width: 100%;
  }

  .page-header > div:last-child .btn {
    flex: 1 1 auto;
  }

  .modal-content-card {
    max-height: 96vh;
  }
}

@media (max-width: 480px) {
  .admin-layout {
    padding: 0.4rem;
  }

  .admin-content {
    padding: 0.8rem;
    border-radius: 16px;
  }

  .admin-topbar-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
  }

  .admin-topbar-nav > div:last-child {
    width: 100%;
    justify-content: space-between;
  }

  .admin-topbar-nav > div:last-child .btn {
    min-height: 36px;
    padding: 0.35rem 0.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card-prodify {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .stat-card-top {
    min-height: 1.3rem;
  }

  .stat-value {
    font-size: 1.45rem;
  }

  .stat-label {
    font-size: 0.73rem;
  }

  .dash-hero-actions {
    grid-template-columns: 1fr;
  }

  .dash-hero-title {
    overflow-wrap: anywhere;
  }

  .form-actions {
    gap: 0.55rem;
  }

  .filter-group-wrap {
    grid-template-columns: 1fr;
  }

  .filter-group-wrap .input-icon-wrapper,
  .filter-group-wrap .table-search-input {
    grid-column: auto;
  }

  .login-header {
    padding: 1.6rem 1.15rem 1.2rem;
  }

  .login-body {
    padding: 1.25rem 1.15rem 1.4rem;
  }

  .login-feature-chips {
    gap: 0.4rem;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
