/* StrikeCRM — iOS + Japanese Bento Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === Design Tokens — Soft Minimalism === */
:root {
  --bg-base: #0a0a0a;
  --bg-surface: rgba(255,255,255,0.03);
  --bg-elevated: rgba(255,255,255,0.06);
  --bg-glass: rgba(20,20,20,0.7);
  --bg-overlay: rgba(0,0,0,0.85);
  
  --text-primary: rgba(255,255,255,0.92);
  --text-secondary: rgba(255,255,255,0.70);
  --text-tertiary: rgba(255,255,255,0.50);
  --text-muted: rgba(255,255,255,0.30);
  
  --accent: #00d66f;
  --accent-hover: #00b85f;
  --accent-muted: rgba(0,214,111,0.12);
  --accent-glow: rgba(0,214,111,0.25);
  
  --status-success: #34c759;
  --status-warning: #ff9f0a;
  --status-error: #ff453a;
  --status-info: #0a84ff;
  --status-neutral: #8e8e93;
  
  --border-hairline: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.18);
  
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 32px var(--accent-glow);
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg-base: #ffffff;
  --bg-surface: rgba(0,0,0,0.02);
  --bg-elevated: rgba(0,0,0,0.04);
  --bg-glass: rgba(255,255,255,0.85);
  --bg-overlay: rgba(0,0,0,0.5);
  
  --text-primary: rgba(0,0,0,0.92);
  --text-secondary: rgba(0,0,0,0.60);
  --text-tertiary: rgba(0,0,0,0.40);
  --text-muted: rgba(0,0,0,0.20);
  
  --accent: #00b85f;
  --accent-hover: #009d52;
  --accent-muted: rgba(0,184,95,0.10);
  --accent-glow: rgba(0,184,95,0.20);
  
  --border-hairline: rgba(0,0,0,0.06);
  --border-subtle: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.16);
  
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.16);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
}

/* === Typography === */
h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.15; margin-bottom: 32px; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 20px; }
h3 { font-size: 17px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* === Layout === */
.sidebar {
  width: 260px; min-height: 100vh;
  background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-hairline);
  position: fixed; left: 0; top: 0; z-index: 100;
  display: flex; flex-direction: column;
  transition: transform 0.3s var(--ease-out);
}
.sidebar-logo { padding: 24px; border-bottom: 1px solid var(--border-hairline); display: flex; justify-content: space-between; align-items: center; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.logo-text span { color: var(--accent); font-weight: 700; }

.theme-toggle {
  width: 36px; height: 36px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-tertiary); font-size: 16px;
  cursor: pointer; transition: all 0.2s;
}
.theme-toggle:hover { background: var(--bg-elevated); color: var(--accent); border-color: var(--accent); }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all 0.2s;
}
.sidebar-nav a:hover { background: var(--bg-surface); color: var(--text-primary); }
.sidebar-nav a.active { background: var(--accent-muted); color: var(--accent); font-weight: 600; }
.sidebar-nav a .nav-icon { width: 22px; height: 22px; flex-shrink: 0; }

.sidebar-user { padding: 16px; border-top: 1px solid var(--border-hairline); display: flex; align-items: center; gap: 12px; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.logout-btn {
  background: none; border: 1px solid var(--border-subtle); color: var(--text-tertiary);
  border-radius: var(--radius-md); padding: 7px 12px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.logout-btn:hover { border-color: var(--status-error); color: var(--status-error); }

.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  padding: 40px 48px 48px;
}

/* === Cards — Bento Grid === */
.bento-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s var(--ease-out);
}
.bento-card:hover { transform: translateY(-2px); border-color: var(--border-subtle); }

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.bento-grid .bento-card .value { font-size: 36px; font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -1px; }
.bento-grid .bento-card .label { font-size: 12px; color: var(--text-tertiary); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 500; }

/* === Panels — Glass Cards === */
.panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
}
.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.panel-header h3 { font-size: 16px; font-weight: 600; }
.panel-body { padding: 24px; }

/* === Tables === */
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-surface); }
th {
  text-align: left; padding: 14px 16px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-tertiary); border-bottom: 1px solid var(--border-hairline);
}
td {
  padding: 16px; font-size: 14px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-hairline);
}
tbody tr { transition: background 0.15s; cursor: pointer; }
tbody tr:hover { background: var(--bg-surface); }
tbody tr:last-child td { border-bottom: none; }

/* === Forms === */
input, select, textarea {
  width: 100%; padding: 12px 16px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: inherit; font-size: 14px; transition: all 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
input::placeholder { color: var(--text-muted); }

/* === Buttons === */
.btn {
  padding: 11px 20px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface); color: var(--text-secondary);
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent); color: var(--bg-base); border-color: var(--accent);
  font-weight: 600; box-shadow: 0 4px 12px var(--accent-muted);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); }
.btn-secondary { background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.btn-danger { background: rgba(255,69,58,0.1); color: var(--status-error); border: 1px solid rgba(255,69,58,0.2); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* === Filter Buttons === */
.filter-btn, .filter-tab {
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-tertiary); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.filter-btn:hover, .filter-tab:hover { background: var(--bg-elevated); color: var(--text-secondary); }
.filter-btn.active, .filter-tab.active {
  background: var(--accent-muted); color: var(--accent); border-color: var(--accent); font-weight: 600;
}

/* === Controls Bar === */
.controls { display: flex; gap: 12px; margin-bottom: 24px; align-items: center; flex-wrap: wrap; }
.controls input { max-width: 320px; }

/* === Badges === */
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; line-height: 1.4;
}
.badge-green { background: rgba(52,199,89,0.15); color: var(--status-success); border: 1px solid rgba(52,199,89,0.2); }
.badge-yellow { background: rgba(255,159,10,0.15); color: var(--status-warning); border: 1px solid rgba(255,159,10,0.2); }
.badge-blue { background: rgba(10,132,255,0.15); color: var(--status-info); border: 1px solid rgba(10,132,255,0.2); }
.badge-red { background: rgba(255,69,58,0.15); color: var(--status-error); border: 1px solid rgba(255,69,58,0.2); }
.badge-gray { background: var(--bg-surface); color: var(--text-tertiary); border: 1px solid var(--border-hairline); }

/* === Detail Grid === */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.detail-field label { display: block; font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.6px; font-weight: 600; margin-bottom: 8px; }
.detail-field .val { font-size: 14px; font-weight: 400; }

.empty { text-align: center; padding: 56px 24px; color: var(--text-muted); font-size: 13px; }

/* ============================================ */
/* MOBILE CHROME                                */
/* ============================================ */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-hairline);
  z-index: 90;
  align-items: center; padding: 0 16px; gap: 12px;
}
.hamburger-btn {
  width: 44px; height: 44px; background: none; border: none;
  color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:active { background: var(--bg-surface); }
.mobile-header .page-title {
  font-size: 17px; font-weight: 600; letter-spacing: -0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: var(--bg-overlay); z-index: 150;
  animation: fadeIn 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-hairline);
  z-index: 80;
  justify-content: space-around; padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px; flex: 1;
  color: var(--text-tertiary); font-size: 10px; font-weight: 500;
  transition: color 0.2s; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav a .nav-icon { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a:active { background: var(--bg-surface); border-radius: var(--radius-md); }

/* ============================================ */
/* MOBILE BREAKPOINT                            */
/* ============================================ */
@media (max-width: 768px) {
  .main-wrapper { margin-left: 0; }
  .sidebar {
    transform: translateX(-100%);
    width: 80%; max-width: 280px;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }
  .sidebar-overlay.open { display: block; }
  
  .main {
    padding: 72px 16px 96px;
  }
  
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }
  .bento-card { padding: 20px; }
  .bento-grid .bento-card .value { font-size: 32px; }
  .bento-grid .bento-card .label { font-size: 11px; }
  
  .btn { padding: 13px 20px; min-height: 48px; font-size: 14px; }
  .btn-sm { padding: 9px 14px; min-height: 40px; }
  .filter-btn, .filter-tab { padding: 10px 16px; min-height: 44px; font-size: 13px; }
  
  input, select, textarea { font-size: 16px; padding: 14px 16px; }
  
  .panel-header { padding: 18px 20px; }
  .panel-body { padding: 20px; }
  
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 13px; }
  th, td { padding: 12px 14px; }
  
  .controls, .controls input { flex-direction: column; max-width: 100%; }
  
  h1 { font-size: 24px; margin-bottom: 24px; }
  .sidebar-nav a { padding: 13px 16px; font-size: 15px; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
