/* Directorio IIEE - UGEL Utcubamba - Estilo profesional */
:root {
    --primary: #0d3563;
    --primary-light: #1a4c9e;
    --primary-soft: #e8eef5;
    --accent: #25d366;
    --accent-hover: #20bd5a;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-soft: #4a5568;
    --muted: #718096;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --radius: 10px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-size: 15px;
}

.page-header {
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 50%, #1e5a9e 100%);
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.page-header h1 i {
    margin-right: 0.4rem;
    opacity: 0.95;
}

.page-header p {
    margin: 0;
    opacity: 0.92;
    font-size: 1rem;
    font-weight: 500;
}

.main-content {
    padding: 2rem 0 3rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.toolbar .form-group { margin: 0; }

.toolbar .form-control {
    max-width: 340px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.toolbar .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 76, 158, 0.12);
    outline: none;
}

.filter-nivel {
    display: flex;
    align-items: center;
}

.filter-nivel label {
    margin: 0;
    font-weight: 600;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.filter-nivel .form-control {
    min-width: 200px;
    margin-left: 0.5rem;
}

#contador {
    margin-left: auto;
    font-weight: 600;
    color: var(--primary-light);
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.table-directorio {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
}

.table-directorio th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.85rem 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    border: none;
}

.table-directorio th:first-child { border-radius: var(--radius) 0 0 0; }
.table-directorio th:last-child { border-radius: 0 var(--radius) 0 0; }

.table-directorio td {
    padding: 0.75rem;
    font-size: 0.9rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
}

.table-directorio tbody tr:last-child td { border-bottom: none; }

.table-directorio tbody tr:hover {
    background: var(--primary-soft);
}

.table-directorio .cod-mod {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem;
}

.table-directorio .iiee {
    font-weight: 600;
    color: var(--text);
}

/* Celular + botón WhatsApp */
.table-directorio .telefono {
    white-space: nowrap;
}

.tel-text {
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff !important;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.45);
    color: #fff !important;
}

.btn-whatsapp:active {
    transform: scale(0.98);
}

.btn-whatsapp i {
    font-size: 1.15rem;
}

/* Columna Email */
.table-directorio .email {
    word-break: break-all;
}
.table-directorio .email a {
    color: var(--primary-light);
    text-decoration: none;
}
.table-directorio .email a:hover {
    text-decoration: underline;
}

.main-content .btn-outline-primary {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: 2px solid var(--primary-light);
    color: var(--primary-light);
    transition: all 0.2s;
}

.main-content .btn-outline-primary:hover {
    background: var(--primary-light);
    color: #fff;
    border-color: var(--primary-light);
}

#sin-resultados {
    padding: 2rem 1rem !important;
    font-size: 1rem;
}

.alert-warning {
    border-radius: var(--radius);
    border: 1px solid #f0e6c8;
}

@media (max-width: 768px) {
    .page-header { padding: 1.5rem 0.75rem; }
    .page-header h1 { font-size: 1.45rem; }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    .toolbar .form-control { max-width: none; }
    .filter-nivel {
        flex-wrap: wrap;
    }
    .filter-nivel .form-control {
        margin-left: 0;
        min-width: 100%;
    }
    #contador { margin-left: 0; }
    .table-directorio th,
    .table-directorio td {
        font-size: 0.78rem;
        padding: 0.55rem 0.5rem;
    }
    .btn-whatsapp {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }
    .btn-whatsapp i { font-size: 1rem; }
}
