@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --marino: #243e61;
    --marino-oscuro: #06102f;
    --acento: #2EA3F2;
    --acento-dark: #1a8fd1;
    --gris-bg: #f5f7fa;
    --gris-borde: #e2e5ed;
    --gris-texto: #555;
    --rojo: #e74c3c;
    --verde: #27ae60;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--gris-bg);
    color: #333;
    min-height: 100vh;
}

/* ---- Header ---- */
.gi-header {
    background: #fff;
    padding: 0 2rem;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #000;
    position: sticky;
    top: 0;
    z-index: 100;
}

.gi-header .logo img { height: 34px; }

.gi-header .nav-user {
    color: #555;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.gi-header .nav-user strong { color: #222; }

.gi-header .nav-user a {
    color: var(--marino);
    text-decoration: none;
    transition: color 0.2s;
}

.gi-header .nav-user a:hover { color: var(--acento); }
.gi-header .nav-user a.nav-activo { color: var(--acento); font-weight: 600; }

/* ---- Login ---- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--marino);
}

.login-box {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.login-box .login-logo {
    text-align: center;
    margin-bottom: 1.8rem;
}

.login-box .login-logo img { height: 48px; }

.login-box h1 {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--marino);
    margin-bottom: 1.8rem;
}

/* ---- Container ---- */
.gi-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.gi-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--marino);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ---- Cards ---- */
.gi-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

.gi-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--marino);
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--gris-borde);
}

/* ---- Forms ---- */
.gi-form-group { margin-bottom: 1rem; }

.gi-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.3rem;
}

.gi-form-group input,
.gi-form-group select,
.gi-form-group textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--gris-borde);
    border-radius: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.gi-form-group input:focus,
.gi-form-group select:focus,
.gi-form-group textarea:focus {
    border-color: var(--acento);
}

.gi-form-group textarea { resize: vertical; min-height: 100px; }

.gi-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.58rem 1.15rem;
    border-radius: 7px;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
    white-space: nowrap;
}

.btn-primary { background: var(--marino); color: #fff; }
.btn-primary:hover { background: var(--marino-oscuro); }

.btn-acento { background: var(--acento); color: #fff; }
.btn-acento:hover { background: var(--acento-dark); }

.btn-success { background: var(--verde); color: #fff; }
.btn-success:hover { background: #1e8449; }

.btn-danger { background: var(--rojo); color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gris-borde);
    color: #555;
}
.btn-outline:hover { border-color: var(--acento); color: var(--acento); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Alerts ---- */
.gi-alert {
    padding: 0.75rem 1rem;
    border-radius: 7px;
    margin-bottom: 1rem;
    font-size: 0.86rem;
}
.gi-alert-error  { background: #fde8e8; color: #c0392b; border-left: 4px solid var(--rojo); }
.gi-alert-success{ background: #e8f8f0; color: #1e8449; border-left: 4px solid var(--verde); }
.gi-alert-info   { background: #e8f4fd; color: #1a5276; border-left: 4px solid var(--acento); }

/* ---- Table ---- */
.gi-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }

.gi-table th {
    text-align: left;
    padding: 0.65rem 1rem;
    background: var(--gris-bg);
    color: #777;
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gris-borde);
}

.gi-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--gris-borde);
    color: #444;
    vertical-align: middle;
}

.gi-table tr:hover td { background: #fafbfc; }

.gi-table .actions { display: flex; gap: 0.4rem; }

/* ---- Breadcrumb ---- */
.gi-breadcrumb {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 1.5rem;
}
.gi-breadcrumb a { color: var(--acento); text-decoration: none; }
.gi-breadcrumb a:hover { text-decoration: underline; }
.gi-breadcrumb span { color: #ccc; margin: 0 0.35rem; }

/* ---- Carpetas ---- */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.folder-item {
    background: var(--gris-bg);
    border: 1.5px solid var(--gris-borde);
    border-radius: 9px;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--marino);
    transition: all 0.18s;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
}

.folder-item:hover { border-color: var(--acento); background: #e8f4fd; }
.folder-icon { font-size: 1.9rem; display: block; margin-bottom: 0.35rem; }

/* ---- Archivos ---- */
.file-list { border: 1px solid var(--gris-borde); border-radius: 8px; overflow: hidden; }

.file-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--gris-borde);
    gap: 0.75rem;
    font-size: 0.87rem;
    transition: background 0.15s;
}

.file-item:last-child { border-bottom: none; }
.file-item:hover { background: #fafbfc; }
.file-icon { font-size: 1.3rem; flex-shrink: 0; }
.file-name { flex: 1; font-weight: 500; color: #333; word-break: break-all; }
.file-meta { color: #bbb; font-size: 0.76rem; white-space: nowrap; }
.file-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

/* ---- Upload area ---- */
.upload-area {
    border: 2px dashed var(--gris-borde);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #aaa;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--acento);
    background: #e8f4fd;
    color: var(--acento);
}
.upload-area input[type=file] { display: none; }
.upload-area .upload-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.upload-area p { font-size: 0.88rem; margin-bottom: 0.3rem; }
.upload-area small { font-size: 0.78rem; color: #ccc; }

/* ---- Badge ---- */
.badge {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 600;
}
.badge-admin { background: #fde8c8; color: #b7600a; }
.badge-user  { background: #e8f4fd; color: #1a5276; }

/* ---- Modal ---- */
.gi-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.gi-modal-overlay.open { display: flex; }

.gi-modal {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}
.gi-modal h2 { font-size: 1.1rem; color: var(--marino); margin-bottom: 1.2rem; }
.gi-modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ---- Progress bar ---- */
.upload-progress { display: none; margin-top: 1rem; }
.progress-bar-wrap { background: var(--gris-borde); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { background: var(--acento); height: 100%; width: 0; transition: width 0.3s; border-radius: 20px; }
.progress-label { font-size: 0.8rem; color: #888; text-align: center; margin-top: 0.35rem; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: 10px; padding: 1.2rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-card .stat-num { font-size: 1.8rem; font-weight: 700; color: var(--marino); }
.stat-card .stat-label { font-size: 0.8rem; color: #aaa; margin-top: 0.2rem; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .gi-container { padding: 1rem; }
    .folder-grid { grid-template-columns: repeat(2, 1fr); }
    .gi-form-row { grid-template-columns: 1fr; }
    .gi-header { padding: 0 1rem; }
    .file-meta { display: none; }
}
