/* Rathin Law Office — theme styles matching the design screenshots */

:root {
    --sidebar-bg: #1f2a30;
    --sidebar-bg-hover: #15191c;
    --sidebar-active: #1b242a;
    --sidebar-text: #b8c7ce;
    --topbar-bg: #4b8db5;
    --topbar-bg-dark: #3c7ea6;
    --content-bg: #eceff1;
    --accent-blue: #29b6d8;
    --accent-cyan: #25b6d6;
    --accent-orange: #f0932b;
    --danger: #e8593e;
    --success: #27ae60;
    --heading: #5a6268;
    --title-blue: #29b6d8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Source Sans Pro", "Segoe UI", Arial, sans-serif;
    background: var(--content-bg);
    color: #444;
    font-size: 14px;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 230px;
    min-width: 230px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
}
.sidebar-logo {
    text-align: center;
    padding: 26px 0 30px;
}
.sidebar-logo img,
.sidebar-logo .logo-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    font-weight: 700;
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: .3px;
    border-left: 3px solid transparent;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-nav a:hover { background: var(--sidebar-bg-hover); color: #fff; }
.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--accent-blue);
}

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--topbar-bg);
    color: #fff;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 0 18px;
}
.topbar .hamburger { font-size: 18px; cursor: pointer; }
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
}
.topbar .brand-name { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.topbar .brand-name .logo-circle {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.signout {
    background: var(--danger);
    color: #fff;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 22px;
    text-decoration: none;
    font-size: 14px;
}
.signout:hover { background: #d6492f; color:#fff; }

.content { flex: 1; padding: 26px 30px; }

.footer {
    background: #fff;
    border-top: 1px solid #e2e6ea;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
}
.footer b { color: #333; }

/* ---------- Section headings (dashboards) ---------- */
.section-title {
    font-size: 22px;
    font-weight: 400;
    color: #4a4a4a;
    letter-spacing: .5px;
    margin: 8px 0 4px;
}
.section-rule { border: 0; border-top: 1px solid #d7dde0; margin: 0 0 26px; }

/* ---------- Tiles ---------- */
.tiles { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 30px; }
.tile {
    width: 230px;
    height: 150px;
    border-radius: 3px;
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
    transition: transform .08s ease, filter .12s ease;
}
.tile:hover { filter: brightness(1.06); transform: translateY(-2px); color: #fff; }
.tile i { font-size: 34px; margin-bottom: 16px; }
.tile span { font-weight: 700; font-size: 15px; line-height: 1.25; }
.tile.cyan { background: var(--accent-cyan); }
.tile.orange { background: var(--accent-orange); }
.tile.sm { width: 200px; height: 135px; }
.tile.sm i { font-size: 28px; margin-bottom: 12px; }
.tile.sm span { font-size: 13px; }

/* ---------- Cards / forms ---------- */
.card-panel {
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(0,0,0,.06);
    margin-bottom: 24px;
}
.card-panel .panel-title {
    text-align: center;
    color: var(--title-blue);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .5px;
    padding: 18px 16px 16px;
    border-bottom: 1px solid #eef1f3;
    text-transform: uppercase;
}
.card-panel .panel-body { padding: 22px 26px; }

.form-row-l {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14px 18px;
    align-items: center;
    margin-bottom: 18px;
}
.form-row-l label { font-weight: 700; color: #555; font-size: 13px; }
.form-row-l.top { align-items: start; }
.form-row-l.top label { padding-top: 8px; }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 50px;
}

.field {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d2d6da;
    border-radius: 3px;
    font-size: 13px;
    background: #fff;
    color: #444;
}
.field:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(41,182,216,.15); }
textarea.field { min-height: 92px; resize: vertical; }
select.field { appearance: auto; }

.radio-row { display: flex; gap: 40px; align-items: center; }
.radio-row label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: #555; }

/* ---------- Buttons ---------- */
.btn {
    border: 0;
    border-radius: 3px;
    padding: 9px 20px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    letter-spacing: .3px;
}
.btn-go, .btn-success { background: var(--success); }
.btn-reset, .btn-danger { background: var(--danger); }
.btn-blue, .btn-primary { background: var(--accent-blue); }
.btn-update { background: var(--accent-blue); }
.btn:hover { filter: brightness(.95); }
.btn-bar { display: flex; gap: 10px; }
.btn-bar.center { justify-content: center; }
.btn-bar.right { justify-content: flex-end; }

/* ---------- Tables ---------- */
.table-wrap { background: #fff; overflow-x: auto; border-radius: 3px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    min-width: 1100px;
}
table.data thead th {
    text-align: left;
    font-weight: 700;
    color: #555;
    padding: 12px 10px;
    border-bottom: 2px solid #e3e7ea;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 11.5px;
}
table.data tbody td {
    padding: 11px 10px;
    border-bottom: 1px solid #eef1f3;
    vertical-align: top;
    color: #555;
}
table.data tbody tr:hover { background: #f7fafb; }
.page-title {
    color: var(--title-blue);
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.icon-link { color: var(--accent-orange); font-size: 18px; }

/* ---------- Masters ---------- */
.master-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid #d7dde0;
}
.master-tab {
    padding: 9px 18px;
    text-decoration: none;
    color: #5a6268;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    margin-bottom: -1px;
}
.master-tab:hover { background: #fff; color: var(--accent-blue); }
.master-tab.active {
    background: #fff;
    color: var(--accent-blue);
    border-color: #d7dde0;
    border-bottom: 1px solid #fff;
}
.flash-ok {
    background: #e4f6ee;
    border: 1px solid #b7e3cf;
    color: #1d7a4d;
    padding: 11px 16px;
    border-radius: 3px;
    margin-bottom: 18px;
    font-size: 13px;
}
.field-error { color: var(--danger); font-size: 12.5px; margin: -8px 0 6px; }
.icon-btn-danger {
    border: 0;
    background: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}
.icon-btn-danger:hover { filter: brightness(.9); }

/* ---------- Tom Select (searchable dropdowns) ---------- */
.ts-wrapper { width: 100%; }
.ts-wrapper.single .ts-control,
.ts-control {
    border: 1px solid #d2d6da;
    border-radius: 3px;
    padding: 8px 11px;
    font-size: 13px;
    min-height: 38px;
    background: #fff;
    color: #444;
    box-shadow: none;
}
.ts-wrapper.focus .ts-control {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(41,182,216,.15);
}
.ts-control input, .ts-control input::placeholder { color: #777; font-size: 13px; }
.ts-dropdown {
    border: 1px solid #d2d6da;
    border-radius: 0 0 3px 3px;
    font-size: 13px;
    margin-top: 2px;
}
.ts-dropdown .option { padding: 8px 11px; }
.ts-dropdown .active { background: var(--accent-blue); color: #fff; }
.ts-dropdown .ts-dropdown-content { max-height: 260px; }

/* ---------- Calendar ---------- */
.cal-legend {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px;
    color: #555;
    font-weight: 600;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend .dot { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
#case-calendar { --fc-border-color: #e3e7ea; --fc-today-bg-color: #eef8fb; font-size: 13px; }
.fc .fc-button-primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    text-transform: capitalize;
    font-size: 13px;
}
.fc .fc-button-primary:hover { filter: brightness(.95); background: var(--accent-blue); border-color: var(--accent-blue); }
.fc .fc-button-primary:disabled { background: #9ccfdf; border-color: #9ccfdf; }
.fc .fc-toolbar-title { font-size: 18px; color: #4a4a4a; }
.fc-event { cursor: pointer; font-size: 12px; }

/* ---------- Modal popup ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 40px 16px;
    overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
    overflow: hidden;
    animation: modalIn .14s ease;
}
@keyframes modalIn { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
    background: #4b8db5;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
#case-modal-title { font-size: 16px; font-weight: 700; }
.modal-badge {
    display: inline-block;
    margin-top: 5px;
    background: rgba(255,255,255,.22);
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.modal-close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}
.modal-close:hover { opacity: 1; }
.modal-body { padding: 8px 18px; max-height: 60vh; overflow-y: auto; }
.modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-table th {
    text-align: left;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    padding: 9px 12px 9px 0;
    white-space: nowrap;
    vertical-align: top;
    width: 42%;
}
.modal-table td { padding: 9px 0; color: #333; border-bottom: 1px solid #f0f2f4; }
.modal-table tr:last-child td, .modal-table tr:last-child th { border-bottom: 0; }
.modal-foot {
    padding: 14px 18px;
    border-top: 1px solid #eef1f3;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------- Login ---------- */
.login-page {
    background: linear-gradient(135deg, #1f2a30 0%, #34607a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    width: 100%;
    max-width: 380px;
    border-radius: 6px;
    box-shadow: 0 14px 50px rgba(0,0,0,.35);
    overflow: hidden;
}
.login-logo {
    background: var(--topbar-bg);
    color: #fff;
    text-align: center;
    padding: 28px 20px 22px;
}
.login-logo .logo-circle {
    width: 56px; height: 56px; border-radius: 50%; border: 2px solid #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 24px;
}
.login-brand { font-size: 22px; font-weight: 700; letter-spacing: 1px; margin-top: 12px; }
.login-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.login-body { padding: 26px 26px 30px; }
.login-label { display: block; font-size: 11px; font-weight: 700; color: #888; letter-spacing: .5px; margin: 12px 0 6px; }
.login-input { position: relative; }
.login-input i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #aab2b8; font-size: 13px; }
.login-input input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #d2d6da;
    border-radius: 3px;
    font-size: 14px;
}
.login-input input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(41,182,216,.15); }
.login-remember { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #666; margin: 16px 0 20px; }
.login-btn { width: 100%; padding: 11px; font-size: 14px; }
.login-error {
    background: #fdecea; border: 1px solid #f5c6cb; color: #b73b32;
    padding: 10px 14px; border-radius: 3px; font-size: 13px; margin-bottom: 8px;
}

/* topbar user */
.topbar .user-name { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.signout-form { height: 100%; }
.signout-form .signout { border: 0; cursor: pointer; font-family: inherit; }

/* responsive helper */
@media (max-width: 900px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-row-l { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}
