@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --ivory:     #faf7f2;
    --ivory2:    #f3ede3;
    --ivory3:    #ece4d6;
    --white:     #ffffff;
    --indigo:    #3d3580;
    --indigo2:   #5b52a8;
    --indigo-bg: #eeedf8;
    --gold:      #b8860b;
    --gold-bg:   #fdf6e3;
    --text:      #2c2838;
    --text2:     #5a5370;
    --muted:     #9c94ae;
    --border:    #ddd5c8;
    --border2:   #ede6dc;
    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 2px 12px rgba(61,53,128,0.08);
    --shadow-md: 0 4px 24px rgba(61,53,128,0.13);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--ivory);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* HEADER */
.site-header {
    background: var(--white);
    border-bottom: 2px solid var(--border2);
    box-shadow: 0 2px 8px rgba(61,53,128,0.06);
}
.header-inner {
    display: flex; align-items: center;
    justify-content: space-between; padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: linear-gradient(135deg, var(--indigo), var(--indigo2));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; flex-shrink: 0;
}
.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; font-weight: 700; color: var(--indigo); line-height: 1.2;
	margin-bottom: 7px;
}
.brand-sub {
    font-size: 0.68rem; color: var(--muted);
    letter-spacing: 2px; text-transform: uppercase;
	display: block;
}
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text2); text-decoration: none; font-size: 0.9rem;
    transition: color 0.2s;
}
.back-link:hover { color: var(--indigo); }

/* BUTTONS */
.btn-primary {
    background: var(--indigo); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 9px 20px;
    font-weight: 600; font-size: 0.88rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none; transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.btn-primary:hover {
    background: var(--indigo2); color: #fff;
    box-shadow: 0 4px 14px rgba(61,53,128,0.25);
    transform: translateY(-1px);
}
.btn-outline {
    background: var(--white); color: var(--text2);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 18px; font-weight: 500; font-size: 0.88rem;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-bg); }

/* ICON BUTTONS */
.btn-icon {
    width: 32px; height: 32px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem; text-decoration: none; cursor: pointer;
    border: none; transition: transform 0.15s, opacity 0.2s;
}
.btn-icon:hover { transform: scale(1.1); opacity: 0.85; }
.btn-icon-view { background: var(--indigo-bg); color: var(--indigo); }
.btn-icon-edit { background: var(--gold-bg);   color: var(--gold); }
.btn-icon-del  { background: #fff0f0;          color: #c0392b; }

/* CARD */
.card {
    background: var(--white);
    border: 1.5px solid var(--border2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    background: var(--ivory2);
    border-bottom: 1.5px solid var(--border2);
    padding: 12px 20px;
    display: flex; align-items: center; gap: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem; font-weight: 600;
    color: var(--indigo);
}

/* STAT CARD */
.stat-card {
    background: var(--white);
    border: 1.5px solid var(--border2);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem; font-weight: 700; line-height: 1;
}
.stat-lbl { font-size: 0.78rem; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* FORM */
.form-lbl {
    display: block; font-size: 0.82rem; font-weight: 600;
    color: var(--text2); margin-bottom: 5px;
}
.form-inp {
    width: 100%; background: var(--white);
    border: 1.5px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 9px 12px;
    font-size: 0.9rem; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}
.form-inp:focus {
    outline: none;
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(61,53,128,0.1);
}
.form-inp::placeholder { color: var(--muted); }
textarea.form-inp { resize: vertical; min-height: 90px; }
select.form-inp {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%239c94ae' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* TABLE */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
    background: var(--ivory2); color: var(--text2);
    font-size: 0.74rem; font-weight: 700; letter-spacing: 0.8px;
    text-transform: uppercase; padding: 11px 16px;
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
.tbl tbody tr { border-bottom: 1px solid var(--border2); transition: background 0.15s; }
.tbl tbody tr:hover { background: var(--ivory); }
.tbl tbody td { padding: 12px 16px; vertical-align: middle; font-size: 0.88rem; }

/* NUMBER BADGE */
.nbadge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem; font-weight: 700;
}
.nb-indigo { background: var(--indigo-bg); color: var(--indigo); }
.nb-gold   { background: var(--gold-bg);   color: var(--gold); }
.nb-teal   { background: #e8f8f5;          color: #1a9276; }

/* NUM DETAIL CARD */
.num-card {
    background: var(--white); border: 1.5px solid var(--border2);
    border-radius: var(--radius); padding: 16px; text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.num-card:hover { border-color: var(--indigo); box-shadow: var(--shadow); }
.num-big { font-family: 'Playfair Display', serif; font-size: 2.6rem; font-weight: 700; line-height: 1; }
.num-lbl { font-size: 0.7rem; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 5px; font-weight: 600; }
.num-meaning { font-size: 0.78rem; color: var(--text2); margin-top: 8px; line-height: 1.5; }

/* INFO ROW */
.info-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 9px 0; border-bottom: 1px solid var(--border2); gap: 10px;
}
.info-row:last-child { border-bottom: none; }
.info-lbl { font-size: 0.8rem; color: var(--muted); font-weight: 500; flex-shrink: 0; }
.info-val { font-size: 0.87rem; color: var(--text); font-weight: 500; text-align: right; }

/* TIMELINE */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
    width: 2px; background: var(--border2); border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 16px; }
.tl-dot {
    position: absolute; left: -22px; top: 7px;
    width: 12px; height: 12px; border-radius: 50%;
    border: 2.5px solid var(--border); background: var(--white);
}
.tl-dot.sig { background: var(--indigo); border-color: var(--indigo); }
.tl-card {
    background: var(--white); border: 1.5px solid var(--border2);
    border-radius: var(--radius-sm); padding: 12px 15px;
    box-shadow: 0 1px 6px rgba(61,53,128,0.05);
    transition: box-shadow 0.2s;
}
.tl-card:hover { box-shadow: var(--shadow); }
.tl-date { font-size: 0.77rem; color: var(--muted); font-weight: 500; }
.tl-title { font-weight: 600; font-size: 0.93rem; color: var(--text); margin: 4px 0 2px; }
.tl-detail { font-size: 0.83rem; color: var(--text2); line-height: 1.5; }

/* BADGES */
.cat-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 0.71rem; font-weight: 600;
}
.cycle-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 0.71rem; background: var(--indigo-bg); color: var(--indigo);
    border: 1px solid #d0ccf0;
}
.tag-pill {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 500; margin: 2px;
    background: var(--indigo-bg); color: var(--indigo); border: 1px solid #d0ccf0;
}
.acc-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
}
.acc-high { background: #e8f8f0; color: #1a7a4a; }
.acc-mid  { background: var(--gold-bg); color: var(--gold); }
.acc-low  { background: #fff5f5; color: #c0392b; }

/* ALERTS */
.alert-success { background: #f0faf5; border: 1.5px solid #a8ddc4; color: #1a7a4a; border-radius: var(--radius-sm); padding: 12px 16px; }
.alert-error   { background: #fff5f5; border: 1.5px solid #f5c6c6; color: #c0392b; border-radius: var(--radius-sm); padding: 12px 16px; }
.alert-info    { background: var(--indigo-bg); border: 1.5px solid #d0ccf0; color: var(--indigo); border-radius: var(--radius-sm); padding: 12px 16px; }

/* FILTER BAR */
.filter-bar {
    background: var(--white); border: 1.5px solid var(--border2);
    border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow);
}

/* AVATAR */
.avatar {
    width: 66px; height: 66px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; margin: 0 auto 10px;
}
.av-male   { background: #eef4ff; }
.av-female { background: #fef0f6; }

/* ADD EVENT BOX */
.add-event-box {
    background: var(--ivory2); border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm); padding: 18px; margin-top: 6px;
}

/* GENDER */
.g-male   { color: #3d6bcc; font-weight: 600; font-size: 0.85rem; }
.g-female { color: #c0446a; font-weight: 600; font-size: 0.85rem; }

/* LIVE PREVIEW */
.prev-card {
    background: var(--ivory2); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px; text-align: center;
    transition: border-color 0.2s;
}
.prev-card:hover { border-color: var(--indigo); }
.prev-num { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; line-height: 1; }
.prev-lbl { font-size: 0.68rem; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; font-weight: 600; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 2.8rem; display: block; margin-bottom: 10px; opacity: 0.3; }

/* PAGINATION */
.page-link { background: #fff !important; border-color: var(--border) !important; color: var(--text2) !important; }
.page-item.active .page-link { background: var(--indigo) !important; border-color: var(--indigo) !important; color: #fff !important; }
.page-link:hover { background: var(--indigo-bg) !important; color: var(--indigo) !important; }

.modal-content {
    border-radius: 15px;
}
.btn-light {
    background: #f8f9fa;
    border: 1px solid #eee;
    color: #666;
}