/* Fuente Quicksand desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    --bg: #f7f8fa;
    --card: #ffffff;
    --border: #e6e9ef;
    --text: #2a2f3a;
    --muted: #8b93a7;
    --brand-yellow: #FBB61A;
    --brand-blue: #3B89C9;
    --brand-blue-hover: #2f74ad;
    --danger: #e5484d;
    --ok: #30a46c;
    --shadow: 0 1px 3px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Quicksand', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 48px 16px;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: 640px; }
.container.narrow { max-width: 380px; }
.container.wide { max-width: 980px; }

/* Cabecera con logo */
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}
.brand img { height: 56px; width: auto; }

h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -.01em; }
.subtitle { color: var(--muted); margin-bottom: 28px; font-weight: 500; }

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    background: var(--card);
    padding: 56px 24px;
    text-align: center;
    cursor: pointer;
    color: var(--muted);
    transition: border-color .2s, background .2s, color .2s;
    box-shadow: var(--shadow);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    background: #f5faff;
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dropzone-inner span { font-weight: 600; }

/* Lista de subida */
.file-list { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.file-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.file-item.error { border-color: var(--danger); }
.file-name { font-size: .92rem; font-weight: 600; margin-bottom: 10px; word-break: break-all; }
.progress { height: 7px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-yellow), var(--brand-blue));
    width: 0;
    transition: width .25s ease;
}
.file-status { margin-top: 10px; font-size: .85rem; color: var(--muted); font-weight: 500; }
.result-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Login */
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 15px;
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 500;
}
.login-form input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(59, 137, 201, .12);
}
.login-form button {
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.login-form button:hover { background: var(--brand-blue-hover); }
.error-msg { color: var(--danger); margin-bottom: 16px; font-weight: 600; }

/* Panel admin */
.admin-header { display: flex; justify-content: space-between; align-items: center; }
.admin-header .brand { margin-bottom: 0; }
.admin-header .brand img { height: 40px; }
.logout { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; }
.logout:hover { color: var(--text); }
.panel-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 8px 4px;
    margin-top: 20px;
    overflow: hidden;
}
.files-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.files-table th, .files-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.files-table tr:last-child td { border-bottom: none; }
.files-table th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.files-table td.name { word-break: break-all; max-width: 280px; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px; font-weight: 500; }

/* Botones de icono (panel y página pública) */
.actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
    background: #f5faff;
}
.icon-btn.download:hover {
    color: var(--ok);
    border-color: var(--ok);
    background: #f3fbf6;
}
.icon-btn.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: #fef4f4;
}
.icon-btn.copied {
    color: var(--ok);
    border-color: var(--ok);
    background: #f3fbf6;
}

/* --- Gestión de usuarios --- */
.notice-msg {
    color: var(--ok);
    background: #f3fbf6;
    border: 1px solid #cdeedd;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-weight: 600;
}
.error-msg {
    background: #fef4f4;
    border: 1px solid #f6d5d5;
    border-radius: 10px;
    padding: 12px 16px;
}

/* Formulario de creación de usuario */
.user-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.user-form input,
.user-form select {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: .92rem;
    font-weight: 500;
    flex: 1 1 180px;
}
.user-form input:focus,
.user-form select:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(59, 137, 201, .12);
}
.user-form button {
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    flex: 0 0 auto;
}
.user-form button:hover { background: var(--brand-blue-hover); }

/* Insignias de rol */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.badge-admin {
    color: #8a5a00;
    background: rgba(251, 182, 26, .18);
}
.badge-uploader {
    color: var(--brand-blue);
    background: rgba(59, 137, 201, .14);
}
.tag-you {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    background: #eef1f6;
}
.muted-dash { color: var(--muted); }
