@tailwind base;
@tailwind components;
@tailwind utilities;

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Hide arrow glyph */
details > summary {
  list-style: none;
  cursor: pointer;
}

/* Hide arrow glyph in Safari */
details > summary::-webkit-details-marker {
    display: none;
}


/* ===========================================
   Workspace Design System
   =========================================== */

:root {
  --ws-bg: #f6f9fc;
  --ws-panel: #ffffff;
  --ws-panel-2: #fbfcfe;
  --ws-text: #0a2540;
  --ws-muted: #6b7c93;
  --ws-line: #e6ebf1;
  --ws-primary: #635bff;
  --ws-primary-2: #7a73ff;
  --ws-success: #0a7c3e;
  --ws-danger: #d33c5a;
  --ws-radius: 14px;
  --ws-radius-sm: 10px;
  --ws-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
}

/* Panel */
.ws-panel {
  background: var(--ws-panel);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius);
  box-shadow: var(--ws-shadow);
  overflow: hidden;
}

.ws-panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ws-line);
  background: linear-gradient(180deg, #fff, #fcfdff);
}

.ws-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ws-text);
}

.ws-panel-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ws-muted);
}

.ws-panel-body {
  padding: 20px;
}

.ws-panel-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--ws-line);
  background: var(--ws-panel-2);
}

/* Section dividers */
.ws-section {
  padding: 20px;
  border-bottom: 1px solid var(--ws-line);
}

.ws-section:last-child {
  border-bottom: none;
}

.ws-section-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ws-text);
}

.ws-section-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ws-muted);
}

/* Cards within panels */
.ws-card {
  margin-top: 16px;
  padding: 16px;
  background: var(--ws-panel-2);
  border-radius: var(--ws-radius-sm);
  border: 1px solid var(--ws-line);
}

.ws-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Buttons */
.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ws-line);
  background: #fff;
  color: var(--ws-text);
  border-radius: var(--ws-radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.ws-btn:hover {
  background: #f8fafc;
  border-color: #d0d5dd;
}

.ws-btn.primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--ws-primary-2), var(--ws-primary));
  color: #fff;
}

.ws-btn.primary:hover {
  opacity: 0.9;
}

.ws-btn.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.ws-btn.danger:hover {
  background: #fee2e2;
}

.ws-btn.danger-solid {
  border-color: transparent;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff;
}

/* Pills & Badges */
.ws-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: #4d4f7c;
  background: #f2f1ff;
  border: 1px solid #d7d4ff;
  border-radius: 999px;
  padding: 4px 10px;
}

.ws-pill.success {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.ws-pill.warning {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.ws-pill.danger {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.ws-pill.muted {
  color: var(--ws-muted);
  background: #f3f6fa;
  border-color: var(--ws-line);
}

.ws-count-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--ws-muted);
  background: #f3f6fa;
  border: 1px solid var(--ws-line);
  border-radius: 999px;
  padding: 2px 8px;
}

/* Stats */
.ws-stat {
  font-size: 28px;
  font-weight: 700;
  color: var(--ws-primary);
  line-height: 1.2;
}

.ws-stat-label {
  font-size: 12px;
  color: var(--ws-muted);
  margin-top: 2px;
}

/* Tables */
.ws-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ws-table thead {
  background: var(--ws-panel-2);
  border-bottom: 1px solid var(--ws-line);
}

.ws-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--ws-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ws-table td {
  padding: 12px 16px;
  color: var(--ws-text);
  border-bottom: 1px solid #f1f4f8;
}

.ws-table tbody tr:hover {
  background: #fafbfc;
}

.ws-table tbody tr:last-child td {
  border-bottom: none;
}

/* Grid layouts */
.ws-grid {
  display: grid;
  gap: 16px;
}

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

.ws-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .ws-grid-2, .ws-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Alert boxes */
.ws-alert {
  padding: 16px;
  border-radius: var(--ws-radius-sm);
  border: 1px solid;
}

.ws-alert.info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ws-alert.warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.ws-alert.danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.ws-alert-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ws-alert.info .ws-alert-title { color: #1e40af; }
.ws-alert.warning .ws-alert-title { color: #92400e; }
.ws-alert.danger .ws-alert-title { color: #991b1b; }

.ws-alert-text {
  font-size: 13px;
  color: var(--ws-muted);
}

/* Empty state */
.ws-empty {
  text-align: center;
  padding: 48px 24px;
}

.ws-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--ws-muted);
}

.ws-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ws-text);
  margin-bottom: 8px;
}

.ws-empty-text {
  font-size: 14px;
  color: var(--ws-muted);
}

/* Tabulator overrides */
.tabulator {
  border: 1px solid var(--ws-line);
  border-radius: 12px;
  font-size: 13px;
  overflow: hidden;
}

.tabulator .tabulator-header {
  border-bottom: 1px solid var(--ws-line);
  background: var(--ws-panel-2);
  color: #425466;
  font-weight: 600;
}

.tabulator-row {
  border-bottom: 1px solid #f1f4f8;
}

.tabulator-row.tabulator-selected {
  background: #eef0ff !important;
}
