/* ============================================
   NECA Admin Panel - Styles
   ============================================ */

/* ----- Base Override ----- */

body {
  background: var(--gray-50);
  min-height: 100vh;
  overflow-x: auto;
}


/* ----- Login Screen ----- */

#loginScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 22px;
}

.login-logo h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.login-logo p {
  font-size: 12px;
  color: var(--gray-600);
}

.login-card h2 {
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.login-card .subtitle {
  color: var(--gray-600);
  font-size: 14px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 61, 122, .08);
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  margin-top: 4px;
}

.btn-login:hover {
  background: var(--blue-mid);
  transform: translateY(-1px);
}

.btn-login:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}

.forgot-link:hover {
  color: var(--blue-mid);
}

.login-error {
  background: var(--red-light);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.login-success {
  background: var(--green-light);
  color: var(--green);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}


/* ----- Admin Panel Layout ----- */

:root {
  --red: #c53030;
  --red-light: #fde8e8;
  --green: #276749;
  --green-light: #c6f6d5;
}

#adminPanel {
  display: none;
}

.admin-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--navy);
  color: var(--white);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-topbar h1 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.admin-topbar p {
  font-size: 11px;
  opacity: .65;
}

.topbar-user {
  font-size: 13px;
  opacity: .8;
  margin-right: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-logout {
  padding: 8px 18px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  color: var(--white);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, .2);
}

.admin-layout {
  display: flex;
  padding-top: 60px;
  min-height: 100vh;
}


/* ----- Sidebar ----- */

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 24px 0;
  position: fixed;
  top: 60px;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
  background: var(--blue-light);
  color: var(--blue);
  border-left-color: var(--blue);
}

.sidebar-nav li a.active {
  background: var(--blue-light);
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 600;
}

.sidebar-nav li a .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}


/* ----- Main Content Area ----- */

.admin-content {
  margin-left: 220px;
  padding: 32px;
  flex: 1;
  max-width: calc(100% - 220px);
}

.section-page {
  display: none;
}

.section-page.active {
  display: block;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 1.5rem;
  color: var(--navy);
  font-weight: 800;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--gray-600);
  font-size: 14px;
}


/* ----- Admin Items / Cards ----- */

.admin-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
  background: var(--white);
  transition: box-shadow .2s;
}

.admin-item:hover {
  box-shadow: var(--shadow);
}

.admin-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.admin-item-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 15px;
}

.admin-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.admin-item-details {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.6;
}

.admin-item-details span {
  margin-right: 16px;
}

/* Document category group headers */
.doc-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--navy);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gray-200);
}

.doc-group-header:first-child {
  margin-top: 0;
}

.doc-group-count {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--gray-600);
  background: var(--gray-100, #f1f3f5);
  border-radius: 10px;
  padding: 1px 8px;
}

/* Slideshow drag-and-drop */
.slide-drag-item {
  cursor: grab;
  user-select: none;
}

.slide-drag-item:active {
  cursor: grabbing;
}

.slide-drag-item.drag-over {
  border: 2px dashed var(--blue-mid);
  background: var(--blue-light);
}

.drag-handle {
  color: var(--gray-600);
  font-size: 18px;
  cursor: grab;
  padding: 0 8px 0 0;
  line-height: 1;
}


/* ----- Buttons ----- */

.btn-sm {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  font-family: inherit;
}

.btn-edit {
  background: var(--blue-light);
  color: var(--blue);
}

.btn-edit:hover {
  background: var(--blue);
  color: var(--white);
}

.btn-del {
  background: var(--red-light);
  color: var(--red);
}

.btn-del:hover {
  background: var(--red);
  color: var(--white);
}

.btn-add {
  background: var(--blue);
  color: var(--white);
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  font-family: inherit;
  transition: all .2s;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-add:hover {
  background: var(--blue-mid);
}

.btn-save {
  background: var(--accent);
  color: var(--navy);
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  font-family: inherit;
  transition: all .2s;
}

.btn-save:hover {
  background: #e69915;
}

.btn-save:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn-cancel {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  font-family: inherit;
  transition: all .2s;
}

.btn-cancel:hover {
  background: var(--gray-200);
}

.btn-invite {
  background: var(--blue);
  color: var(--white);
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  font-family: inherit;
  transition: all .2s;
}

.btn-invite:hover {
  background: var(--blue-mid);
}

.btn-invite:disabled {
  opacity: .6;
  cursor: not-allowed;
}


/* ----- Admin Forms ----- */

.admin-form {
  display: none;
  border: 2px solid var(--blue);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
  background: var(--blue-light);
}

.admin-form.active {
  display: block;
}

.admin-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
  margin-top: 14px;
}

.admin-form label:first-of-type {
  margin-top: 0;
}

.work-type-checkboxes {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  margin-bottom: 16px;
  align-items: center;
}

.work-type-checkboxes .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  margin-top: 0;
  margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.admin-form input:not([type="checkbox"]),
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  background: var(--white);
}

.admin-form input:not([type="checkbox"]):focus,
.admin-form textarea:focus,
.admin-form select:focus {
  border-color: var(--blue);
}

.admin-form textarea {
  height: 80px;
  resize: vertical;
}

.form-btns {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}


/* ----- Messages ----- */

.success-msg {
  background: var(--green-light);
  color: var(--green);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

.success-msg.show {
  display: block;
}

.error-msg {
  background: var(--red-light);
  color: var(--red);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

.error-msg.show {
  display: block;
}


/* ----- Logo Upload ----- */

.logo-upload-area {
  margin-top: 8px;
  border: 2px dashed var(--gray-200);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  background: var(--white);
}

.logo-upload-area:hover {
  border-color: var(--blue);
  background: rgba(0, 61, 122, .03);
}

.logo-upload-area input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.logo-upload-area .upload-text {
  font-size: 13px;
  color: var(--gray-600);
}

.logo-upload-area img {
  max-height: 60px;
  max-width: 150px;
  object-fit: contain;
}


/* ----- Users Section ----- */

.users-note {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 20px;
  line-height: 1.6;
}

.admin-user-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-email {
  font-weight: 600;
  color: var(--navy);
  font-size: 14px;
}

.admin-user-meta {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 2px;
}

.invite-form-box {
  border: 2px solid var(--blue);
  border-radius: 10px;
  padding: 24px;
  background: var(--blue-light);
  margin-bottom: 20px;
  display: none;
}

.invite-form-box.active {
  display: block;
}

.invite-form-box label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.invite-form-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  background: var(--white);
  margin-bottom: 14px;
}

.invite-form-box input:focus {
  border-color: var(--blue);
}

.invite-desc {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 14px;
  line-height: 1.6;
}


/* ----- Spinner ----- */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ----- Empty State ----- */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-600);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 15px;
}


/* ----- Responsive ----- */

@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-content {
    margin-left: 0;
    max-width: 100%;
    padding: 20px;
  }
}
