/* Backup Storage Sizing Tool - Niyya Software */

:root {
    --navy:      #1f3864;
    --navy-700:  #16294a;
    --accent:    #2e86c1;
    --accent-2:  #5b9bd5;
    --ink:       #1c2430;
    --muted:     #6b7788;
    --line:      #dfe5ee;
    --bg:        #eef2f7;
    --card:      #ffffff;
    --ok:        #1e8449;
    --warn:      #b9770e;
    --danger:    #c0392b;
    --radius:    10px;
    --shadow:    0 1px 2px rgba(16,36,68,.06), 0 6px 20px rgba(16,36,68,.07);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.5 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }

.muted { color: var(--muted); }
.hint  { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.center { text-align: center; }

/* ----------------------------------------------------------- top bar */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    background: var(--navy);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 10px rgba(16,36,68,.18);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .2px; }
.brand small  { display: block; font-size: 11px; color: #b6c4de; }

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 9px;
    background: linear-gradient(140deg, var(--accent) 0%, #1b4f86 100%);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -.3px;
    color: #fff;
}
.logo-mark span { color: #bfe0ff; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.guest-note { font-size: 12px; color: #c3d2ea; margin-right: 4px; }
.guest-note strong { color: #fff; }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    background: rgba(255,255,255,.12);
    font-size: 13px;
    color: #fff;
    text-decoration: none;
}
a.user-chip:hover { background: rgba(255,255,255,.2); }

.inline-form { display: inline-flex; margin: 0; }
.avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* ------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #256fa3; }

.btn-ghost {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.25);
}
.btn-ghost:hover { background: rgba(255,255,255,.2); }
.btn-ghost.danger { color: #ffb4ab; }

.panel-inputs .btn-ghost,
.modal .btn-ghost {
    background: #fff;
    color: var(--navy);
    border-color: var(--line);
}
.panel-inputs .btn-ghost:hover,
.modal .btn-ghost:hover { background: #f3f6fb; }
.modal .btn-ghost.danger { color: var(--danger); }

.btn-sso   { background: #fff; color: var(--navy); }
.btn-sso:hover { background: #eef3fb; }
.btn-sso .opt { font-weight: 400; color: var(--muted); }
.sso-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), #1b4f86);
    display: inline-block;
}

.btn-word  { background: #2b579a; color: #fff; }
.btn-excel { background: #1e7145; color: #fff; }
.btn-ppt   { background: #c04526; color: #fff; }
.btn-word:hover  { background: #234880; }
.btn-excel:hover { background: #165c38; }
.btn-ppt:hover   { background: #a13a20; }

/* ------------------------------------------------------------- layout */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 18px;
    padding: 18px;
    align-items: start;
    max-width: 1680px;
    margin: 0 auto;
}

@media (max-width: 1180px) {
    .layout { grid-template-columns: 1fr; }
    .panel-results { position: static !important; }
}

/* -------------------------------------------------------------- cards */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--navy);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.card > summary::-webkit-details-marker { display: none; }
.card > summary::after {
    content: "\25BE";
    margin-left: auto;
    color: var(--muted);
    transition: transform .15s;
}
.card[open] > summary::after { transform: rotate(180deg); }
.card > summary:hover { background: #f7f9fc; }

.step {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.card-body { padding: 4px 16px 18px; border-top: 1px solid var(--line); }

/* -------------------------------------------------------------- forms */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
.span-2 { grid-column: 1 / -1; }
.span-4 { grid-column: 1 / -1; }

@media (max-width: 640px) {
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #33415a;
    margin-top: 10px;
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
    width: 100%;
    margin-top: 5px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(46,134,193,.15);
}
textarea { resize: vertical; }

.checkline {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    margin-top: 14px;
}
.checkline input { width: auto; margin: 0; }

.range-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.gfs-state {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #1d6f42;
    background: #eafaf1;
}
.gfs-state.manual { color: #7a4d06; background: #fdf6e8; }
.out-table tr.tier th { padding-left: 14px; color: var(--muted); font-size: 12px; }
.out-table tr.tier td { color: var(--muted); font-size: 12px; }

.range-row output {
    min-width: 46px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--navy);
}

hr.span-2 { border: 0; border-top: 1px solid var(--line); margin: 16px 0 2px; }

.platform-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    background: #f2f7fc;
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    font-size: 12.5px;
    color: #3c4a60;
}

/* ------------------------------------------------------ workload table */

.table-scroll { overflow-x: auto; margin-top: 10px; }

.input-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.input-table th {
    text-align: left;
    padding: 8px 6px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.input-table td { padding: 4px 4px; border-bottom: 1px solid #f0f3f8; }
.input-table input[type=text],
.input-table input[type=number],
.input-table select { margin-top: 0; padding: 6px 8px; font-size: 13px; }
.input-table input[type=number] { min-width: 76px; }

.row-del {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 5px;
}
.row-del:hover { background: #fdecea; color: var(--danger); }

.row-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.row-actions .hint { margin: 0; flex: 1; min-width: 220px; }

.disclaimer {
    font-size: 12px;
    color: var(--muted);
    padding: 12px 14px;
    background: #fdf6e8;
    border: 1px solid #f0e0bd;
    border-radius: var(--radius);
}

/* ------------------------------------------------------------ results */

.panel-results {
    position: sticky;
    top: 78px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 96px);
}

.results-inner {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.loading { color: var(--muted); padding: 30px; text-align: center; }

.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.metrics.small .m-value { font-size: 18px; }

.metric {
    background: #f6f8fc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.metric.accent {
    background: linear-gradient(150deg, var(--navy) 0%, #2a4f88 100%);
    border-color: var(--navy);
}
.metric.accent .m-label { color: #b9cbe8; }
.metric.accent .m-value { color: #fff; }
.metric.accent .m-sub   { color: #9fb7db; }

.m-label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.m-value { font-size: 21px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.m-sub   { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.out-section {
    margin: 20px 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--accent);
    border-bottom: 1px solid var(--line);
    padding-bottom: 5px;
}

.out-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.out-table th {
    text-align: left;
    font-weight: 500;
    color: #42506a;
    padding: 6px 0;
    border-bottom: 1px solid #f0f3f8;
    width: 62%;
}
.out-table td {
    text-align: right;
    padding: 6px 0;
    border-bottom: 1px solid #f0f3f8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.out-table tr.sub th, .out-table tr.sub td { font-weight: 700; color: var(--navy); background: #f6f8fc; }
.out-table tr.total th, .out-table tr.total td {
    font-weight: 700;
    color: #fff;
    background: var(--navy);
    padding-left: 8px;
    padding-right: 8px;
}
.out-table tr.warn td { color: var(--warn); font-weight: 700; }

.out-table.grid th, .out-table.grid td { text-align: right; }
.out-table.grid thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--muted);
}
.out-table.grid tbody td:first-child,
.out-table.grid thead th:first-child { text-align: left; }

/* ---------------------------------------------- backup storage target */

.target-warn {
    margin: 0 0 8px;
    padding: 8px 10px;
    font-size: 12.5px;
    color: #7a4d06;
    background: #fdf6e8;
    border: 1px solid #f0e0bd;
    border-left: 3px solid var(--warn);
    border-radius: 0 6px 6px 0;
}
.target-sub { margin: 4px 0 0; font-size: 13px; color: #42506a; }
.target-src { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }

/* Long values (ingest, immutability, protocols) wrap instead of being clipped. */
.target-table th { width: 42%; vertical-align: top; }
.target-table td { white-space: normal; overflow-wrap: anywhere; padding-left: 10px; }

.model-table { margin-top: 10px; }
.model-table th + th, .model-table td + td { padding-left: 14px; }
.model-table tr.chosen td { font-weight: 700; color: var(--navy); background: #eef4fb; }
.model-table tr.nofit td { color: var(--muted); }

#generic-fields { margin: 0; }
#generic-fields > label { margin-top: 10px; }

.assumptions { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: #42506a; }
.assumptions li { margin-bottom: 6px; }

.export-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}
.export-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 700;
    margin-right: 2px;
}

/* -------------------------------------------------------------- modal */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(16,26,44,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
}
.modal[hidden] { display: none; }

.modal-card {
    background: #fff;
    border-radius: var(--radius);
    width: min(560px, 100%);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(10,20,40,.35);
}
.modal-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}
.modal-card h2 { margin: 0; font-size: 16px; color: var(--navy); }
.modal-close {
    border: 0; background: none; font-size: 24px; line-height: 1;
    color: var(--muted); cursor: pointer;
}
.modal-body { padding: 14px 18px; overflow-y: auto; }

.project-list { list-style: none; margin: 0; padding: 0; }
.project-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.project-list small { display: block; color: var(--muted); font-size: 11.5px; }
.project-list span { display: flex; gap: 6px; }

/* -------------------------------------------------------------- toast */

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: #fff;
    padding: 11px 20px;
    border-radius: 24px;
    font-size: 13px;
    box-shadow: 0 8px 26px rgba(10,20,40,.3);
    z-index: 80;
}
.toast[hidden] { display: none; }

/* -------------------------------------------------------- auth screen */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(150deg, #1f3864 0%, #2e5f96 55%, #3f83bd 100%);
    padding: 24px;
}

.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 30px 32px 24px;
    width: min(420px, 100%);
    box-shadow: 0 24px 70px rgba(8,18,38,.35);
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand .logo-mark { width: 52px; height: 52px; font-size: 15px; margin-bottom: 12px; }
.auth-brand h1 { font-size: 19px; margin: 0 0 6px; color: var(--navy); }
.auth-brand p { margin: 0; font-size: 12.5px; }

.auth-card .btn { width: 100%; }
.auth-card .btn-sso { border: 1px solid var(--line); }
.auth-card label { margin-top: 12px; }

.stack { display: block; }
.stack .btn { margin-top: 18px; }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 12px;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tab {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}
.tab.active { color: var(--navy); border-bottom-color: var(--accent); }

.auth-foot { text-align: center; margin: 20px 0 0; font-size: 11.5px; }

.alert {
    padding: 10px 13px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 14px;
}
.alert-error { background: #fdecea; color: #922b21; border: 1px solid #f5c6c0; }
.alert-ok    { background: #eafaf1; color: #1d6f42; border: 1px solid #b9e4cb; }
