:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --bg-gradient: linear-gradient(135deg, #f5f3ff 0%, #e0e7ff 100%);
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
}

body {
    background: var(--bg-gradient);
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 30px;
    min-height: 100vh;
}

.container { max-width: 1250px; margin: 0 auto; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.logo-area h1 { color: var(--primary); margin: 0; font-weight: 700; font-size: 28px; }
.logo-area p { margin: 0; color: var(--text-muted); font-size: 14px; }

.btn-notify {
    background: white; color: var(--primary); border: 2px solid var(--primary);
    padding: 8px 18px; border-radius: 50px; font-weight: 600; cursor: pointer;
    transition: 0.3s;
}
.btn-notify:hover { background: var(--primary); color: white; }

/* Cards */
.card {
    background: var(--card-bg); border-radius: 20px; padding: 30px;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.15); margin-bottom: 25px; border: 1px solid #f3f4f6;
}

/* Form */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; align-items: end; }
.input-group { display: flex; flex-direction: column; }
label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }

input, select {
    padding: 12px; border: 1px solid var(--border); border-radius: 10px;
    background: #f9fafb; font-family: inherit; font-size: 14px;
    outline: none; transition: 0.3s;
}
input:focus, select:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1); }

.mt-5 { margin-top: 8px; }

/* Buttons */
.btn-add {
    background: var(--primary); color: white; border: none; padding: 14px;
    border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.3s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}
.btn-add:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-update {
    background: #f59e0b; color: white; border: none; padding: 14px;
    border-radius: 12px; font-weight: 600; cursor: pointer;
}

/* Backup Zone */
.backup-zone { text-align: center; padding: 20px; border: 2px dashed #cbd5e1; background: #f8fafc; }
.backup-title { margin: 0 0 15px 0; font-size: 14px; color: #64748b; font-weight: 600; text-transform: uppercase; }
.btn-outline { background: white; border: 1px solid #cbd5e1; padding: 8px 16px; border-radius: 8px; cursor: pointer; margin: 0 5px; }
.btn-solid { background: #374151; color: white; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; margin: 0 5px; }

/* Table */
.section-title { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.section-title h2 { color: #374151; font-size: 20px; border-left: 5px solid var(--primary); padding-left: 10px; }
.drag-hint { font-size: 12px; color: #9ca3af; font-style: italic; }

.table-container { background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.05); margin-bottom: 25px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f5f3ff; color: var(--primary-dark); padding: 16px; font-size: 14px; }
td { padding: 16px; border-bottom: 1px solid #f3f4f6; font-size: 14px; vertical-align: middle; }
tr.draggable-row { cursor: move; }
tr.dragging { opacity: 0.5; background: #f3f4f6; }
tr:hover { background: #fafafa; }

.main-text { display: block; font-weight: 600; color: var(--text-main); }
.sub-text { display: block; font-size: 12px; color: #9ca3af; margin-top: 4px; }
.perk-text { color: #059669; font-weight: 500; font-size: 12px; display: block; margin-top: 2px; }

/* Badges */
.badge { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-High { background: #fee2e2; color: #ef4444; }
.badge-Medium { background: #fef3c7; color: #d97706; }
.badge-Low { background: #d1fae5; color: #059669; }

.countdown { font-family: 'Courier New', monospace; font-weight: 700; color: var(--primary); }

/* Actions */
.action-btn { border: none; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; margin-right: 4px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.btn-check { background: #d1fae5; color: #059669; }
.btn-cross { background: #fee2e2; color: #ef4444; }
.btn-edit { background: #dbeafe; color: #2563eb; }

/* History */
.history-controls { text-align: center; margin: 30px 0; }
.btn-toggle-history { background: white; border: 1px solid #d1d5db; padding: 10px 24px; border-radius: 50px; cursor: pointer; font-weight: 600; }
.hidden { display: none; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.btn-clear { background: #fee2e2; color: #ef4444; border: none; padding: 6px 16px; border-radius: 8px; cursor: pointer; }
.status-Completed { color: #10b981; font-weight: bold; background: #ecfdf5; padding: 4px 10px; border-radius: 6px; }
.status-Canceled { color: #ef4444; font-weight: bold; background: #fef2f2; padding: 4px 10px; border-radius: 6px; }

/* PRINT PDF STYLE (The Magic Part) */
@media print {
    body { background: white; padding: 0; }
    .no-print { display: none !important; }
    .container { max-width: 100%; }
    .table-container { box-shadow: none; border: 1px solid #ccc; }
    th { background: #f3f4f6 !important; color: black !important; border-bottom: 2px solid #000; }
    td { border-bottom: 1px solid #ddd; }
    .badge { border: 1px solid #ccc; background: none !important; color: black !important; }
    .countdown { color: black !important; }
}