* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

header h1 {
    font-size: 20px;
    font-weight: 700;
}

.subtitle {
    color: #aaa;
    font-size: 14px;
}

main {
    max-width: 800px;
    margin: 24px auto;
    padding: 0 16px;
}

/* --- Draft Assistant Form --- */
.assistant-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-desc {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.15);
}

.btn-draft {
    background: #25d366;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
}

.btn-draft:hover {
    background: #1da851;
}

.btn-draft:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.btn-loading {
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.error-msg {
    background: #fef2f2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* --- Draft Result --- */
.result-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-left: 4px solid #25d366;
}

.result-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-body {
    padding: 16px;
}

.result-draft {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 12px;
}

.btn-copy {
    background: #1a1a2e;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-copy:hover {
    background: #2d2d4e;
}

.copy-feedback {
    color: #25d366;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
}

/* --- Section Title --- */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px;
}

/* --- Pending Webhook Drafts --- */
.draft-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.draft-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.draft-header strong {
    font-size: 15px;
}

.sender-type {
    background: #e8f0fe;
    color: #1967d2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.phone {
    color: #888;
    font-size: 13px;
    margin-left: auto;
}

.incoming {
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.incoming label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.message-text {
    font-size: 14px;
    white-space: pre-wrap;
}

.draft-reply {
    padding: 12px 16px;
}

.draft-reply label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    color: #333;
}

textarea:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.15);
}

.actions {
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

.btn-send {
    background: #25d366;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-send:hover {
    background: #1da851;
}

.btn-reject {
    background: none;
    color: #888;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-reject:hover {
    background: #f5f5f5;
    color: #e53935;
    border-color: #e53935;
}

/* --- Label Hints --- */
.label-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: #bbb;
    font-size: 11px;
}

/* --- Rating Buttons --- */
.result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-buttons {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-rate {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-rate:hover {
    background: #f5f5f5;
}

.btn-rate.active {
    border-color: #25d366;
    background: #f0fdf4;
}

.btn-rate-down:hover {
    border-color: #e53935;
}

.btn-rate-down.active {
    border-color: #e53935;
    background: #fef2f2;
}

.rate-feedback {
    font-size: 12px;
    color: #888;
}

/* --- Notification Bell --- */
.notif-wrapper {
    position: relative;
    margin-left: 8px;
}

.notif-bell {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}

.notif-bell:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.notif-badge {
    position: absolute;
    top: 0;
    right: -2px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* --- Notification Dropdown Panel --- */
.notif-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    z-index: 200;
    overflow: hidden;
    margin-top: 8px;
}

.notif-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.notif-mark-all {
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.notif-mark-all:hover {
    background: #e8f0fe;
}

.notif-list {
    max-height: 420px;
    overflow-y: auto;
}

.notif-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover {
    background: #f8f9fa;
}

.notif-item.unread {
    background: #f0f7ff;
}

.notif-item.unread:hover {
    background: #e3effc;
}

.notif-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.notif-priority.urgent { background: #e53935; }
.notif-priority.normal { background: #f59e0b; }
.notif-priority.low { background: #9e9e9e; }

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.notif-body {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-time {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.notif-empty {
    text-align: center;
    color: #aaa;
    padding: 32px;
    font-size: 14px;
}

.notif-dismiss {
    background: none;
    border: none;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
    border-radius: 4px;
    line-height: 1;
}

.notif-dismiss:hover {
    color: #e53935;
    background: #fef2f2;
}

/* --- Nav link separator dot --- */
.nav-sep {
    color: rgba(255,255,255,0.2);
    font-size: 10px;
    align-self: center;
}

/* Responsive */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .rating-buttons {
        margin-left: 0;
        margin-top: 8px;
    }
    .notif-panel {
        width: calc(100vw - 24px);
        right: -8px;
    }
    .nav-sep { display: none; }
}
