* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #333; }

/* Navbar */
.navbar { display: flex; align-items: center; justify-content: space-between; background: #1a1a2e; color: #fff; padding: 0 24px; height: 56px; }
.nav-brand { font-weight: 700; font-size: 18px; }
.nav-links { display: flex; gap: 8px; }
.nav-links a { color: #ccc; text-decoration: none; padding: 8px 14px; border-radius: 6px; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,0.1); }
.nav-logout { margin-left: 16px; }

/* Container */
.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
h1 { font-size: 24px; margin-bottom: 16px; }

/* Buttons */
.btn { display: inline-block; padding: 8px 16px; border: 1px solid #ddd; border-radius: 6px; background: #fff; color: #333; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f0f0f0; }
.btn-primary { background: #4361ee; color: #fff; border-color: #4361ee; }
.btn-primary:hover { background: #3a56d4; }
.btn-secondary { background: #e9ecef; border-color: #ccc; }
.btn-warning { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
.table th { background: #f8f9fa; font-weight: 600; font-size: 13px; text-transform: uppercase; color: #666; }
.table .empty { text-align: center; padding: 32px; color: #999; }
.row-inactive { opacity: 0.5; }

/* Actions */
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.inline-form { display: inline; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-red { background: #fee2e2; color: #991b1b; }

/* Links */
.link-truncate { color: #4361ee; text-decoration: none; font-size: 13px; }
.link-truncate:hover { text-decoration: underline; }

/* Forms */
.form-card { background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); max-width: 600px; }
.form-card label, .form-card fieldset { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.form-card input[type="text"], .form-card input[type="url"], .form-card input[type="time"],
.form-card input[type="number"], .form-card input[type="password"],
.form-card select, .form-card textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.form-card textarea { resize: vertical; }
.form-card fieldset { border: 1px solid #eee; padding: 12px; border-radius: 6px; }
.form-card legend { font-weight: 500; padding: 0 6px; }
.checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-label { font-weight: 400; display: flex; align-items: center; gap: 4px; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; }

/* Cards (templates) */
.cards { display: flex; flex-direction: column; gap: 16px; }
.card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card-inactive { opacity: 0.6; }
.card-new { border: 2px dashed #ddd; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title-input { font-size: 16px; font-weight: 600; border: none; background: transparent; width: 70%; }
.card-title-input:focus { outline: none; border-bottom: 2px solid #4361ee; }
.card label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 500; }
.card select, .card input[type="number"], .card input[type="text"], .card textarea {
    display: block; width: 100%; margin-top: 4px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.card textarea { resize: vertical; }
.card-actions { display: flex; gap: 6px; margin-top: 12px; }
.card h3 { margin-bottom: 12px; }
.preview-hint { font-size: 12px; color: #999; margin-bottom: 6px; }
.preview-box { background: #f8f9fa; padding: 10px; border-radius: 6px; font-size: 13px; white-space: pre-wrap; min-height: 40px; color: #555; margin-bottom: 8px; }
.timing-value-label .timing-hint { font-size: 12px; color: #666; }

/* Filters */
.filters { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 20px; background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); flex-wrap: wrap; }
.filters label { font-size: 14px; font-weight: 500; }
.filters select, .filters input { display: block; margin-top: 4px; padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }

/* Login */
.login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-form { background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); width: 360px; }
.login-form h1 { text-align: center; margin-bottom: 24px; }
.login-form p { font-size: 14px; color: #666; margin-bottom: 16px; }
.login-form label { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.login-form input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.login-form button { width: 100%; padding: 10px; margin-top: 8px; }
.alert { padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fee2e2; color: #991b1b; }

/* Copy button feedback */
.btn-copied { background: #10b981 !important; border-color: #10b981 !important; color: #fff !important; }
