/* =========================================================
   RONEX Life Insurance - ONE stylesheet for the whole system
   Link it in any page with:  <link rel="stylesheet" href="assets/style.css">
   Change the colors below to re-theme everything.
   ========================================================= */
:root {
    --green-900: #0d4a26;
    --green-800: #14602f;
    --green-700: #1b7a3d;
    --green-600: #23964a;
    --green-100: #e3f3e6;
    --green-50:  #f2faf3;
    --bg:        #e9f2ea;
    --text:      #1c2b21;
    --muted:     #6b7d70;
    --line:      #d5e3d8;
    --white:     #ffffff;
    --red:       #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout: sidebar + main ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--green-800), var(--green-900));
    color: #fff;
    padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.brand .logo-svg { display: block; flex-shrink: 0; }
.brand b { display: block; font-size: 20px; letter-spacing: 1px; }
.brand small { display: block; font-size: 9px; letter-spacing: 2px; opacity: .8; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 4px;
    color: #e6f4ea;
    border-radius: 8px;
    font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.10); text-decoration: none; }
.sidebar nav a.active { background: var(--green-600); color: #fff; }
.sidebar nav .ico { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.sidebar nav .ico .icon { width: 20px; height: 20px; }

.main { flex: 1; min-width: 0; padding: 22px 28px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
}
.topbar b { color: var(--green-800); }

.card {
    background: var(--white);
    border-radius: 14px;
    padding: 24px 26px;
    box-shadow: 0 2px 10px rgba(13, 74, 38, .08);
}
.card h2 { margin: 0 0 18px; font-size: 24px; color: var(--green-900); }
.card h3 { margin: 26px 0 10px; font-size: 17px; color: var(--green-800); }

.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------- Flash messages ---------- */
.flash { padding: 11px 14px; border-radius: 8px; margin: 0 0 16px; font-weight: 500; }
.flash.ok  { background: #dff3e0; color: #17592a; border: 1px solid #b7e0bd; }
.flash.err { background: #fde3e1; color: #8e2318; border: 1px solid #f3bcb6; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; background: #fff; }
th {
    text-align: left;
    background: var(--green-50);
    color: var(--green-900);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 2px solid var(--line);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: var(--green-50); }
/* cancel the old border="1" attribute so only soft horizontal lines show */
table, table[border] { border: 0; }
th, td { border-left: 0; border-right: 0; border-top: 0; }

/* ---------- Forms ---------- */
form { margin: 0; }
label { font-weight: 500; font-size: 14px; }
input[type=text], input[type=password], input[type=number], input[type=date], select {
    width: 100%;
    max-width: 440px;
    padding: 10px 12px;
    margin-top: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--green-600); outline-offset: 0; border-color: var(--green-600); }
input[type=checkbox] { margin-right: 4px; }
input[size], input[name=q] { max-width: 440px; }
input[name=q] { width: 260px; margin: 0 6px 0 0; }
form[method=get] select { width: auto; margin: 0 6px 0 0; }
form[method=get] input[type=date] { width: auto; margin: 0 6px 0 0; }

/* ---------- Buttons ---------- */
button, .btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--green-700);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
button:hover, .btn:hover { background: var(--green-800); text-decoration: none; color: #fff; }
a.btn { padding: 8px 16px; margin-bottom: 6px; }

/* small buttons inside table rows */
a.act, td button {
    display: inline-block;
    padding: 4px 12px;
    margin: 1px 2px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: var(--green-100);
    color: var(--green-800);
    border: 0;
    cursor: pointer;
}
a.act:hover { background: var(--green-600); color: #fff; text-decoration: none; }
button.danger, td button.danger { background: #fde3e1; color: var(--red); }
button.danger:hover, td button.danger:hover { background: var(--red); color: #fff; }
td form { display: inline; }

/* ---------- Status badges ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.b-active, .b-approved   { background: #dff3e0; color: #17592a; }
.b-pending               { background: #fdf0c7; color: #7a5a00; }
.b-in-review             { background: #d9eefc; color: #0d5d94; }
.b-rejected, .b-cancelled{ background: #fde3e1; color: #8e2318; }
.b-lapsed                { background: #e8e8e8; color: #555; }

/* ---------- Dashboard tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 700px; }
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 130px;
    padding: 16px;
    border-radius: 14px;
    color: var(--text);
    text-align: center;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.10); }
.tile .ico { display: inline-flex; margin-bottom: 2px; }
.tile .ico .icon { width: 38px; height: 38px; stroke-width: 1.8; }
.t-blue .ico { color: #1e88e5; } .t-green .ico { color: #2e9e4f; } .t-yellow .ico { color: #ef8a17; }
.t-red .ico { color: #e53935; } .t-purple .ico { color: #7e57c2; } .t-teal .ico { color: #2e9e4f; }
.tile b { font-size: 16px; }
.tile .num { font-size: 26px; font-weight: 700; }
.tile small { color: var(--muted); }
.tile .dot {
    position: absolute; top: 10px; right: 14px;
    background: #e53935; color: #fff;
    min-width: 22px; height: 22px; line-height: 22px;
    border-radius: 11px; font-size: 12px; font-weight: 700;
}
.t-blue   { background: #d9eefc; }
.t-green  { background: #dff3e0; }
.t-yellow { background: #fdf0c7; }
.t-red    { background: #fbd9dc; }
.t-purple { background: #e6dcf8; }
.t-teal   { background: #d6f1ea; }

/* ---------- Login / simple centered pages ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #d9efdc, #9fd3ab 60%, #5fb274);
}
.login-box {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 32px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(13, 74, 38, .25);
}
.login-box .logo { display: flex; justify-content: center; }
.login-box h1 { margin: 6px 0 0; font-size: 28px; letter-spacing: 2px; color: var(--green-900); }
.login-box .sub { margin: 0 0 22px; font-size: 11px; letter-spacing: 3px; color: var(--green-700); }
.login-box form { text-align: left; }
.login-box input[type=text], .login-box input[type=password] { max-width: none; }
.login-box .login-btn { width: 100%; margin-top: 10px; padding: 12px; font-size: 16px; }
.login-box .links { margin-top: 16px; font-size: 14px; }

/* ---------- Print (reports) ---------- */
@media print {
    .sidebar, .topbar, .noprint, .footer { display: none !important; }
    body { background: #fff; }
    .main { padding: 0; }
    .card { box-shadow: none; padding: 0; }
}

/* ---------- Phones / small screens ---------- */
@media (max-width: 800px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; padding: 10px; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .sidebar nav a { padding: 8px 10px; margin: 0; }
    .brand { padding-bottom: 10px; }
    .main { padding: 14px; }
    .card { padding: 16px; overflow-x: auto; }
    table { font-size: 13px; }
    input[name=q] { width: 100%; margin-bottom: 8px; }
}

/* ---------- Icons ---------- */
.icon { width: 1.2em; height: 1.2em; vertical-align: middle; }

/* login fields with left icon and eye button (like the mockup) */
.field { position: relative; margin-bottom: 14px; }
.field input { max-width: none; margin-top: 0; padding: 12px 44px 12px 42px; background: var(--green-50); }
.field .fi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--green-800); display: flex; }
.field .fi .icon { width: 19px; height: 19px; }
.field .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 8px; background: none; color: var(--green-800); border-radius: 6px; }
.field .eye:hover { background: var(--green-100); color: var(--green-800); }
.field .eye .icon { width: 19px; height: 19px; }

/* magnifier inside search boxes */
input[name=q] {
    padding-left: 38px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b7a3d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E") no-repeat 12px center / 18px 18px;
}

/* button with icon (print etc.) */
button .icon, .btn .icon { width: 17px; height: 17px; margin: -3px 6px 0 -2px; }
