/* WordPress-style admin dashboard */
:root {
  --wp-sidebar: #1d2327;
  --wp-sidebar-hover: #2c3338;
  --wp-sidebar-text: #f0f0f1;
  --wp-sidebar-muted: #a7aaad;
  --wp-accent: #2271b1;
  --wp-accent-hover: #135e96;
  --wp-green: #00a32a;
  --wp-red: #d63638;
  --wp-border: #c3c4c7;
  --wp-bg: #f0f0f1;
  --wp-white: #fff;
  --wp-text: #1d2327;
}

* { box-sizing: border-box; }

body.wp-admin {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
  font-size: 13px;
  color: var(--wp-text);
  background: var(--wp-bg);
}

#wpwrap {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-menu {
  width: 160px;
  background: var(--wp-sidebar);
  color: var(--wp-sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.admin-menu__brand a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  color: var(--wp-sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid #3c434a;
}

.admin-menu__logo {
  width: 32px;
  height: 32px;
  background: var(--wp-green);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.admin-menu__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  flex: 1;
}

.admin-menu__list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  color: var(--wp-sidebar-text);
  text-decoration: none;
  font-size: 13px;
}

.admin-menu__list a:hover,
.admin-menu__list .current a {
  background: var(--wp-accent);
  color: #fff;
}

.admin-menu__divider {
  height: 1px;
  background: #3c434a;
  margin: 0.5rem 0.75rem;
}

.admin-menu__user {
  padding: 0.75rem;
  border-top: 1px solid #3c434a;
  font-size: 12px;
}

.admin-menu__user strong {
  display: block;
}

.admin-menu__user small {
  color: var(--wp-sidebar-muted);
}

.dashicon { font-size: 16px; width: 20px; text-align: center; }

/* Content */
#wpcontent {
  margin-left: 160px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#wpadminbar {
  background: var(--wp-white);
  border-bottom: 1px solid var(--wp-border);
  padding: 0 1.25rem;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.wpadminbar__site { font-weight: 600; color: var(--wp-accent); }

.wpadminbar__right {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 12px;
}

.wpadminbar__right a { color: var(--wp-accent); }

.wrap {
  padding: 1.25rem 1.5rem 2rem;
}

.wp-heading {
  margin: 0 0 1rem;
  font-size: 23px;
  font-weight: 400;
  line-height: 1.3;
}

/* Notices */
.notice {
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  border-left: 4px solid;
  background: var(--wp-white);
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.notice-success { border-color: var(--wp-green); }
.notice-error { border-color: var(--wp-red); }
.notice p { margin: 0; }

/* Dashboard widgets */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.widget {
  background: var(--wp-white);
  border: 1px solid var(--wp-border);
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  padding: 1.25rem;
}

.widget__number {
  font-size: 2rem;
  font-weight: 600;
  color: var(--wp-accent);
  line-height: 1;
}

.widget__label {
  color: #646970;
  margin-top: 0.35rem;
}

.postbox {
  background: var(--wp-white);
  border: 1px solid var(--wp-border);
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  margin-bottom: 1.25rem;
}

.postbox-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--wp-border);
  font-weight: 600;
  font-size: 14px;
}

.postbox-body { padding: 0; }

/* Tables */
.wp-list-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--wp-white);
  border: 1px solid var(--wp-border);
}

.wp-list-table th,
.wp-list-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--wp-border);
}

.wp-list-table thead th {
  background: var(--wp-bg);
  font-weight: 600;
}

.wp-list-table tbody tr:hover { background: #f6f7f7; }

.row-actions {
  font-size: 12px;
  color: #646970;
}

.row-actions a { margin-right: 0.5rem; }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pending { background: #fcf9e8; color: #996800; }
.status-processing { background: #e8f4fc; color: #2271b1; }
.status-shipped { background: #e8f0fc; color: #3c434a; }
.status-completed { background: #e8f5e9; color: #00a32a; }
.status-cancelled { background: #fce8e8; color: #d63638; }
.status-published { background: #e8f5e9; color: #00a32a; }
.status-draft { background: #f0f0f1; color: #646970; }

/* Forms */
.admin-form {
  background: var(--wp-white);
  border: 1px solid var(--wp-border);
  padding: 1.25rem;
  max-width: 720px;
}

.form-table {
  width: 100%;
  border-collapse: collapse;
}

.form-table th {
  width: 180px;
  padding: 0.75rem 1rem 0.75rem 0;
  text-align: left;
  font-weight: 600;
  vertical-align: top;
}

.form-table td { padding: 0.5rem 0; }

.form-table input[type="text"],
.form-table input[type="email"],
.form-table input[type="number"],
.form-table input[type="password"],
.form-table input[type="url"],
.form-table select,
.form-table textarea {
  width: 100%;
  max-width: 400px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font: inherit;
}

.form-table textarea { min-height: 100px; max-width: 100%; }

.form-table .description {
  font-size: 12px;
  color: #646970;
  margin-top: 0.25rem;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--wp-border);
  border-radius: 3px;
  background: #f6f7f7;
  color: var(--wp-text);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.button:hover { background: #f0f0f1; text-decoration: none; }

.button-primary {
  background: var(--wp-accent);
  border-color: var(--wp-accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--wp-accent-hover);
  border-color: var(--wp-accent-hover);
  color: #fff;
}

.button-link-delete { color: var(--wp-red); border: 0; background: none; padding-left: 0; cursor: pointer; text-decoration: underline; }

.button-small {
  padding: 0.25rem 0.6rem;
  font-size: 12px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.button-delete {
  background: #fff;
  border-color: var(--wp-red);
  color: var(--wp-red);
  cursor: pointer;
}

.button-delete:hover {
  background: var(--wp-red);
  color: #fff;
}

.row-actions-cell {
  white-space: nowrap;
}

.row-actions-cell .inline-delete-form {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}

.page-actions {
  margin: 0 0 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
}

.search-box input {
  padding: 0.35rem 0.5rem;
  border: 1px solid #8c8f94;
  border-radius: 3px;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--wp-bg);
}

.login-box {
  width: min(100% - 2rem, 360px);
  background: var(--wp-white);
  border: 1px solid var(--wp-border);
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 2rem;
}

.login-box h1 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.login-box .subtitle {
  text-align: center;
  color: #646970;
  margin: 0 0 1.5rem;
  font-size: 13px;
}

.login-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.login-box input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font: inherit;
}

.login-box .button-primary {
  width: 100%;
  padding: 0.6rem;
  font-size: 14px;
}

.login-creds {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f6f7f7;
  border-radius: 4px;
  font-size: 12px;
  color: #646970;
}

.login-creds code { background: #fff; padding: 0.1rem 0.3rem; }

@media (max-width: 782px) {
  .admin-menu {
    width: 100%;
    position: relative;
    height: auto;
  }
  #wpcontent { margin-left: 0; }
  #wpwrap { flex-direction: column; }
}
