@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url("fonts/poppins-300.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/poppins-400.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/poppins-600.woff2") format("woff2");
}
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/poppins-700.woff2") format("woff2");
}

:root {
    /* Paleta oficial mango (brandbook) */
    --mango-red: #dc281d;
    --mango-orange: #ffa100;
    --mango-yellow: #fdd800;
    --mango-black: #000000;
    --mango-gradient: linear-gradient(45deg, var(--mango-red), var(--mango-orange) 55%, var(--mango-yellow));

    --bg: #141210;
    --bg-panel: #1f1b17;
    --bg-panel-2: #2a241d;
    --border: #3d342a;
    --text: #f2ede6;
    --text-dim: #b0a596;
    --accent: var(--mango-orange);
    --accent-dark: #d98800;
    --green: #4ade80;
    --yellow: var(--mango-yellow);
    --red: #ef4444;
    --radius: 8px;

    /* Colores por categoría de credencial */
    --cat-hosting: var(--mango-orange);
    --cat-dominio: var(--mango-red);
    --cat-social: var(--mango-yellow);
    --cat-email: #ff6b4a;
    --cat-pago: #c98a2c;
    --cat-analytics: #a4462f;
    --cat-cms: #7c1d14;
    --cat-otro: #8a8078;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Poppins", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1, h2, h3, .section-title, .cat-label, th, .topbar .brand { font-weight: 600; }
.stat .num { font-weight: 700; }
label, .muted, .form-row label { font-weight: 300; }

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-panel);
    border-bottom: 3px solid transparent;
    border-image: var(--mango-gradient) 1;
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.15rem;
    background: var(--mango-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.topbar nav a { margin-right: 18px; color: var(--text-dim); font-size: .95rem; }
.topbar nav a:hover, .topbar nav a.active { color: var(--accent); text-decoration: none; }

.topbar form { display: inline; }

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-chip .avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 700;
    color: #14100b;
}
.user-chip .user-name { font-size: .9rem; color: var(--text); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.search-box {
    display: flex;
    gap: 8px;
}

input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], select, textarea {
    background: var(--bg-panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--mango-orange);
    box-shadow: 0 0 0 2px rgba(255,161,0,.2);
}

textarea { width: 100%; min-height: 60px; }

button, .btn {
    background: var(--mango-orange);
    color: #201400;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
}
button:hover, .btn:hover { background: #ffb733; }
button.secondary, .btn.secondary { background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); font-weight: 400; }
button.secondary:hover, .btn.secondary:hover { background: var(--border); }
button.danger, .btn.danger { background: var(--mango-red); color: #fff; }
button.danger:hover { background: #f13c2e; }
button.small, .btn.small { padding: 4px 10px; font-size: .8rem; }

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}

/* Franja de color por categoría de credencial */
.card.cat-hosting { border-left: 4px solid var(--cat-hosting); }
.card.cat-dominio { border-left: 4px solid var(--cat-dominio); }
.card.cat-social { border-left: 4px solid var(--cat-social); }
.card.cat-email { border-left: 4px solid var(--cat-email); }
.card.cat-pago { border-left: 4px solid var(--cat-pago); }
.card.cat-analytics { border-left: 4px solid var(--cat-analytics); }
.card.cat-cms { border-left: 4px solid var(--cat-cms); }
.card.cat-otro { border-left: 4px solid var(--cat-otro); }

.cat-label {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    color: #14100b;
}
.cat-label.cat-hosting { background: var(--cat-hosting); }
.cat-label.cat-dominio { background: var(--cat-dominio); color: #fff; }
.cat-label.cat-social { background: var(--cat-social); }
.cat-label.cat-email { background: var(--cat-email); }
.cat-label.cat-pago { background: var(--cat-pago); }
.cat-label.cat-analytics { background: var(--cat-analytics); color: #fff; }
.cat-label.cat-cms { background: var(--cat-cms); color: #fff; }
.cat-label.cat-otro { background: var(--cat-otro); }

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, background .15s;
}
a.stat:hover { border-color: var(--mango-orange); background: var(--bg-panel-2); text-decoration: none; }
.stat .num { font-size: 1.8rem; font-weight: 700; background: var(--mango-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .label { color: var(--text-dim); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: .9rem; overflow-wrap: anywhere; }
th { color: var(--text-dim); font-weight: 600; font-size: .8rem; text-transform: uppercase; }

.table-scroll { width: 100%; overflow-x: auto; }
.cred-table { min-width: 900px; }
.cred-table td, .cred-table th { white-space: nowrap; overflow-wrap: normal; }
.cred-table th:nth-child(1), .cred-table td:nth-child(1) { min-width: 130px; }
.cred-table th:nth-child(2), .cred-table td:nth-child(2) { min-width: 150px; }
.cred-table th:nth-child(3), .cred-table td:nth-child(3) { min-width: 200px; }
.cred-table th:nth-child(4), .cred-table td:nth-child(4) { min-width: 210px; }
.cred-table th:nth-child(5), .cred-table td:nth-child(5) { min-width: 60px; }
.cred-table th:nth-child(6), .cred-table td:nth-child(6) { min-width: 140px; }
.password-field { flex-wrap: nowrap; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.badge.activo { background: rgba(74,222,128,.15); color: var(--green); }
.badge.inactivo { background: rgba(176,165,150,.15); color: var(--text-dim); }
.badge.urgent-red { background: rgba(220,40,29,.18); color: #ff6b5e; }
.badge.urgent-yellow { background: rgba(253,216,0,.15); color: var(--mango-yellow); }
.badge.urgent-green { background: rgba(74,222,128,.15); color: var(--green); }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: .9rem; }
.flash.success { background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.3); color: var(--green); }
.flash.error { background: rgba(220,40,29,.15); border: 1px solid rgba(220,40,29,.4); color: #ff6b5e; }

.password-field { display: flex; align-items: center; gap: 6px; font-family: "Courier New", monospace; }
.password-mask { letter-spacing: 2px; }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.form-row > div { flex: 1; min-width: 160px; }
.form-row label { display: block; font-size: .8rem; color: var(--text-dim); margin-bottom: 4px; }
.form-row input, .form-row select { width: 100%; }

.section-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-dim);
    margin: 22px 0 10px;
    border-left: 3px solid var(--mango-orange);
    padding-left: 10px;
}

.center-box {
    max-width: 380px;
    margin: 80px auto;
    text-align: center;
}
.center-box .card { text-align: left; }

.muted { color: var(--text-dim); font-size: .85rem; }

.inline-form { display: inline; }
