/* Main styles for DevSeige Studios */
:root {
  --bg: #071226;
  --card: #0f1724;
  --muted: #9aa4b2;
  --accent: #22d3b1;
  --accent-600: #10a37f;
  --accent-700: #0b846b;
  --surface: #0b1220;
  --text: #e6f0f2;
  --muted-2: #8f9aa6;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: 'Comfortaa', Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  background: linear-gradient(180deg, #071226, #0b1220);
  padding: 22px 14px;
  box-shadow: 2px 0 14px rgba(2, 6, 12, 0.6);
  display: flex;
  flex-direction: column;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  padding: 12px 8px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0
}

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block
}

/* Small circular logo used in page headings */
.page-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 12px;
  box-shadow: 0 6px 18px rgba(2, 6, 12, 0.6)
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px 18px 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-700) transparent
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--accent-700);
  border-radius: 8px
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent
}

.sidebar-account {
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08)
}

.sidebar-account a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  overflow-wrap: anywhere
}

.sidebar-account a:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5
}

.sidebar-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600
}

.sidebar-nav a:hover {
  background: linear-gradient(90deg, rgba(34, 211, 177, 0.06), rgba(11, 132, 107, 0.03));
  color: var(--accent-700)
}

.nav-group {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-group-label {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  padding: 10px 12px 3px;
  text-transform: uppercase;
}

/* Main content area */
.main-content {
  margin-left: 260px;
  padding: 28px;
  background: transparent;
  min-height: 100vh
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  margin-bottom: 18px
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.user-info {
  font-size: 14px;
  color: var(--muted-2)
}

.role-tag {
  background: rgba(11, 132, 107, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
  margin-left: 8px;
  font-weight: 700;
  color: var(--accent-700)
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  background: transparent;
  padding-bottom: 40px
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 30px rgba(2, 6, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.03)
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.section-heading p {
  margin: 6px 0 0;
}

.team-list {
  display: grid;
  gap: 14px;
}

.team-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 16px;
  min-width: 0;
}

.team-panel h3,
.team-panel h4,
.team-panel h5 {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.team-meta {
  color: var(--muted-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.council-time {
  flex: 0 0 auto;
  background: rgba(34, 211, 177, 0.12);
  color: var(--accent);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
  white-space: nowrap;
}

.team-name-cell,
table td,
table th {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.access-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.access-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  overflow-wrap: anywhere;
}

.access-checks input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 18px;
  align-items: start;
}

.admin-columns > .card {
  min-width: 0;
}

.team-select {
  min-height: 150px;
  width: min(100%, 560px);
  max-width: 100%;
  overflow-y: auto;
}

.internal-team-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.6fr);
  gap: 18px 24px;
  align-items: start;
}

.internal-team-create-form > button {
  grid-column: 1 / -1;
  width: 100%;
}

.internal-team-create-form select {
  font-size: 14px;
}

.regular-team-field {
  min-width: 0;
}

.internal-member-form .regular-team-field {
  grid-column: 1 / -1;
}

.regular-team-field .team-select {
  width: 100%;
  max-width: none;
}

.member-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.member-table-wrap table {
  min-width: 680px;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  min-width: 1120px;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) { width: 44px; }
.users-table th:nth-child(2),
.users-table td:nth-child(2) { width: 48px; }
.users-table th:nth-child(3),
.users-table td:nth-child(3) { min-width: 140px; }
.users-table th:nth-child(4),
.users-table td:nth-child(4) { min-width: 230px; }
.users-table th:nth-child(5),
.users-table td:nth-child(5) { min-width: 180px; }
.users-table th:nth-child(6),
.users-table td:nth-child(6) { min-width: 110px; }
.users-table th:nth-child(7),
.users-table td:nth-child(7) { min-width: 110px; }
.users-table th:last-child,
.users-table td:last-child { width: 148px; }

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.user-actions .action-form {
  display: inline-flex;
}

.audit-table-wrap {
  overflow-x: auto;
}

.audit-table {
  min-width: 980px;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) { width: 170px; }
.audit-table th:nth-child(2),
.audit-table td:nth-child(2) { width: 150px; }
.audit-table th:nth-child(3),
.audit-table td:nth-child(3) { width: 200px; }
.audit-table th:nth-child(4),
.audit-table td:nth-child(4) { width: 150px; }

.audit-when {
  white-space: nowrap;
}

.audit-details {
  min-width: 220px;
  overflow-wrap: anywhere;
}

.member-edit-modal {
  display: none;
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: min(92vw, 680px);
  max-height: 88vh;
  overflow-y: auto;
}

.member-edit-modal.is-visible {
  display: block;
}

/* Buttons */
button,
.btn {
  appearance: none;
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: black;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 8px
}

button.secondary,
.btn.secondary {
  background: transparent;
  border: 1px solid rgba(11, 132, 107, 0.08);
  color: var(--accent-700);
  font-weight: 700
}

button:hover {
  background: var(--accent-600)
}

/* Inline form actions (used in table rows) */
.action-form {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.internal-member-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.internal-member-form .custom-fields,
.internal-member-form > button {
  grid-column: 1 / -1;
}

.custom-field {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.custom-field .icon-only {
  flex: 0 0 38px;
}

.action-form input[type="hidden"] {
  display: none
}

.action-form select {
  width: auto;
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.04)
}

/* Forms */
input,
select,
textarea {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--card);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  font-family: 'Comfortaa', Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif
}

input,
button,
select,
textarea {
  vertical-align: middle
}

/* Button bar used on dashboard */
.button-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0
}

.button-bar .btn {
  padding: 10px 14px;
  border-radius: 10px
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--accent-700)
}

/* Buttons that look like links (for nav) */
.btn-link {
  background: transparent;
  border: 0;
  color: var(--accent-700);
  padding: 6px 8px;
  font-weight: 700
}

/* Material icon sizing */
.material-icons.icon {
  font-size: 20px;
  color: var(--accent-700)
}

.material-icons.btn-icon {
  font-size: 18px;
  color: inherit
}

/* Status icons in tables */
.status-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 6px
}

.status-icon.status-pending {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08)
}

.status-icon.status-in-progress {
  color: var(--accent-700);
  background: rgba(16, 163, 127, 0.06)
}

.status-icon.status-finished {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.06)
}

.status-icon.status-approved {
  color: var(--accent);
  background: rgba(34, 211, 177, 0.06)
}

/* Highlight entire row for approved tasks */
tr.approved-row {
  background: rgba(34, 211, 177, 0.03)
}

/* Icon-only buttons */
.icon-only {
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.icon-only .material-icons {
  font-size: 18px
}

/* make tables scroll on small screens and stack actions */
@media (max-width:900px) {
  table {
    display: block;
    width: 100%;
    overflow: auto
  }

  .action-form {
    flex-direction: column;
    align-items: flex-start
  }

  .icon-only {
    width: 36px;
    height: 36px
  }
}

/* Ensure buttons use the chosen display font */
button,
.btn,
.btn-link,
.icon-only {
  font-family: 'Comfortaa', Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
}

/* Ensure anchors styled as buttons never show underlines on any state */
.btn,
.btn-link,
.icon-only,
.sidebar-nav a,
.sidebar-account a {
  text-decoration: none !important;
}

.btn:hover,
.btn:focus,
.btn:active,
.btn-link:hover,
.btn-link:focus,
.btn-link:active,
.icon-only:hover,
.icon-only:focus,
.icon-only:active {
  text-decoration: none !important;
}

label {
  display: block;
  margin-bottom: 8px
}

[hidden] {
  display: none !important;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  text-align: left
}

th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 700
}

.resource-content pre {
  padding: 14px;
  overflow: auto;
  background: #050b16;
  color: #d5e2e7;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.resource-content code {
  font-family: Consolas, "Courier New", monospace;
}
.resource-content h1,
.resource-content h2,
.resource-content h3,
.resource-content h4,
.resource-content h5,
.resource-content h6 {
  color: var(--text);
  margin-top: 24px;
}
.resource-content blockquote, .card blockquote{margin:16px 0;padding:10px 16px;border-left:3px solid var(--accent);background:rgba(34,211,177,0.06);color:var(--text)}
.resource-content ol,.resource-content ul{margin:12px 0;padding-left:28px}
.resource-modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.65);z-index:999;backdrop-filter:blur(2px)}
.resource-modal-overlay.is-visible{display:block}
.resource-modal{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1000;width:min(90%,700px);max-height:85vh;overflow-y:auto;box-shadow:0 10px 50px rgba(0,0,0,0.8);border:1px solid rgba(255,255,255,0.1)}
.resource-modal.is-visible{display:block}

.task-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.task-form-wide {
  grid-column: 1 / -1;
}

.assignee-list {
  display: grid;
  gap: 8px;
}

.task-assignment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.task-assignment-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-assignment-options input[type="radio"] {
  width: auto;
}

.access-page-group {
  margin-top: 18px;
}

.access-group-heading,
.access-page-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 16px;
}

.access-group-heading {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  padding: 0 0 8px;
  text-transform: uppercase;
}

.access-group-heading h4 {
  color: var(--text);
  font-size: 15px;
  margin: 0;
  text-transform: none;
}

.access-group-heading span {
  text-align: center;
}

.access-page-option {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0;
  padding: 12px 0;
}

.access-page-option input[type="checkbox"] {
  justify-self: center;
  margin: 0;
  width: auto;
}

@media (max-width: 600px) {
  .task-modal-form {
    grid-template-columns: 1fr;
  }
}

/* Resource picker grid on the main resources page */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.resource-tile {
  background: var(--surface, rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.resource-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.resource-tile .material-icons {
  font-size: 28px;
  color: var(--accent);
}
.resource-tile-title {
  font-weight: 700;
  font-size: 15px;
}

/* Responsive */
@media (max-width:800px) {
  .internal-team-create-form {
    grid-template-columns: 1fr;
  }

  .admin-columns {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
  }

  .team-actions {
    width: 100%;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    display: block;
    padding: 10px;
    overflow: visible
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0
  }

  .main-content {
    margin-left: 0;
    padding: 12px
  }
}