:root {
  --bg: #ffffff;
  --bg2: #f5f5f5;
  --text: #1a1a2e;
  --text2: #64748b;
  --accent: #E6552B;
  --border: #e2e8f0;
  --card: #ffffff;
  --header-bg: #ffffff;
  --input-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg2: #1e293b;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --accent: #fb923c;
  --border: #334155;
  --card: #1e293b;
  --header-bg: #0f172a;
  --input-bg: #1e293b;
}

[data-theme="corporate"] {
  --bg: #ffffff;
  --bg2: #f5f5f5;
  --text: #1a1a2e;
  --text2: #64748b;
  --accent: #E6552B;
  --border: #e2e8f0;
  --card: #ffffff;
  --header-bg: #E6552B;
  --input-bg: #ffffff;
}
[data-theme="corporate"] header h1 { color: #fff; }
[data-theme="corporate"] header a,
[data-theme="corporate"] header span { color: rgba(255,255,255,0.8); }

[data-theme="light"] {
  --bg: #f8fafc;
  --bg2: #ffffff;
  --text: #1e293b;
  --text2: #94a3b8;
  --accent: #E6552B;
  --border: #e2e8f0;
  --card: #ffffff;
  --header-bg: #ffffff;
  --input-bg: #ffffff;
}

[data-theme="black"] {
  --bg: #000000;
  --bg2: #0a0a0a;
  --text: #ffffff;
  --text2: #a0a0a0;
  --accent: #E6552B;
  --border: #2a2a2a;
  --card: #0a0a0a;
  --header-bg: #000000;
  --input-bg: #0a0a0a;
}

* { margin:0; padding:0; box-sizing:border-box; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
header h1 { color: var(--accent); font-size: 18px; }
header a, header span { color: var(--text2); text-decoration: none; font-size: 13px; margin-left: 12px; }
header a:hover { color: var(--accent); }

.container { max-width: 800px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  transition: border 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--accent); }
.card h3 { color: var(--accent); font-size: 16px; margin-bottom: 4px; }
.card .meta { color: var(--text2); font-size: 13px; margin-bottom: 6px; }
.card .desc { color: var(--text); font-size: 14px; margin-bottom: 10px; }
.card a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; }
.card a:hover { text-decoration: underline; }

.status {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.status-open { background: rgba(74,222,128,0.15); color: #4ade80; }
.status-progress { background: rgba(251,146,60,0.15); color: #fb923c; }
.status-done { background: rgba(107,157,213,0.15); color: #6b9bd5; }

.empty { text-align: center; color: var(--text2); font-size: 16px; margin-top: 60px; }

input, textarea, select {
  width: 100%; padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
  outline: none; margin-bottom: 12px;
}
input:focus, textarea:focus { border-color: var(--accent); }

button, .btn {
  padding: 10px 20px; background: var(--accent); border: none;
  border-radius: 8px; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
}
button:hover { opacity: 0.85; box-shadow: 0 0 20px rgba(230,85,43,0.3); }

label { color: var(--text2); font-size: 13px; display: block; margin-bottom: 4px; margin-top: 10px; }
label:first-of-type { margin-top: 0; }

h2 { color: var(--accent); font-size: 18px; margin: 24px 0 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text2); padding: 8px; border-bottom: 1px solid var(--border); }
td { padding: 8px; border-bottom: 1px solid var(--border); }
tr:hover { background: var(--bg2); }

form { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
form h3 { color: var(--accent); font-size: 16px; margin-bottom: 12px; }
form button { margin-top: 4px; }

.section { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.del { color: #ff6b6b; font-size: 13px; text-decoration: none; margin-left: 12px; }

.blur { filter: blur(4px); user-select: none; display: inline-block; }

/* Theme toggle */
.theme-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text2); cursor: pointer; font-size: 13px; padding: 4px 8px;
  margin-left: 8px; transition: all 0.2s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width:600px) {
  .section { grid-template-columns: 1fr; }
  header { flex-wrap: wrap; gap: 8px; }
  header h1 { font-size: 16px; }
}
