body {
    margin: 0;
    background: #f4f4f4;
    font-family: Arial, Helvetica, sans-serif;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.login-card h1 {
    margin: 0;
    margin-bottom: .5rem;
}

.login-card p {
    margin-top: 0;
    margin-bottom: 2rem;
    color: #666;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    margin-bottom: .35rem;
    font-weight: bold;
}

.form-group input {
    padding: 0.7rem;
    font-size: 1rem;
    border: 1px solid #bbb;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #1976d2;
}

.error-message {
    margin-bottom: 1.25rem;
    padding: .75rem;
    color: #a00000;
    background: #ffeaea;
    border: 1px solid #ffb5b5;
    border-radius: 4px;
}

/* ===========================
   Panel
   =========================== */

.header {
    max-width: 1200px;

    margin: 2rem auto 0;

    padding: 1.5rem 2rem;

    background: white;

    border: 1px solid #ddd;
    border-radius: 6px;

    display: flex;
    flex-direction: column;

    gap: 1.25rem;
}

.header h1 {
    margin: 0;
    font-size: 1.7rem;
}

.header-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a,
.header-right a {
    color: #1976d2;

    text-decoration: none;

    font-weight: 500;

    padding: .35rem 0;
}

.header-right .button-danger {
    color: white;
}

.nav a:hover,
.header-right a:hover {
    text-decoration: underline;
}

.content {
    max-width: 1200px;

    margin: 2rem auto;

    padding: 2rem;

    background: white;

    border: 1px solid #ddd;
    border-radius: 6px;
}

.content h2 {
    margin-top: 0;
}

.nav a.active {
    font-weight: bold;
    color: #000;
}

.flash-message{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:1rem;
    margin-bottom:1.5rem;

    border-radius:6px;
}

.flash-close{
    background:none;
    border:none;

    font-size:1.3rem;
    font-weight:bold;

    cursor:pointer;

    color:inherit;
}

.flash-message.success{
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.error{
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* ===========================
   Botones
   =========================== */
button.button{
    border: none;      
    font: inherit;
}

.button {
    display: inline-flex;
    
    padding: 0.75rem 1.25rem;

    border: 1px solid transparent;
    border-radius: 4px;

    text-decoration: none;

    font-size: 1rem;
    cursor: pointer;

    line-height: 1;
    align-items: center;
    justify-content: center;

    transition: background-color .2s ease;
}

.button-primary {
    background: #1976d2;
    color: white;
}

.button-primary:hover {
    background: #1565c0;
}

.button-secondary {
    background: #f4f4f4;
    color: #333;
    border-color: #ccc;
}

.button-secondary:hover {
    background: #e9e9e9;
}

.button-danger {
    background: #d32f2f;
    color: white;
}

.button-danger:hover {
    background: #b71c1c;
}

.button-small {
    padding: .45rem .8rem;
    font-size: .9rem;
}

.button-success {
    background: #2e7d32;
    color: white;
}

.button-success:hover {
    background: #1b5e20;
}

.button-warning {
    background: #ed6c02;
    color: white;
}

.button-warning:hover {
    background: #e65100;
}

.actions-menu{
    position:relative;
    display:inline-block;
}

.actions-dropdown{
    position:fixed;

    min-width:180px;

    background:white;

    border:1px solid #ddd;
    border-radius:8px;

    box-shadow:0 4px 12px rgba(0,0,0,.15);

    padding:10px;

    z-index:9999;

    display: none;
    flex-direction: column;
    gap: 6px;
}

.actions-dropdown .action-form {
    margin: 0;
}

.actions-dropdown .action-form,
.actions-dropdown a{
    display: block;
    width: 100%;
}

.actions-dropdown .button{
    width: 80%
}

.renew-form{
    display:none;
    align-items:center;
    gap:6px;
}

.renew-form select{
    flex:1;
}

.renew-form .button{
    width: auto;
    text-align: center;
}

/* ===========================
   Licencias
   =========================== */

.page-actions{
    display:flex;
    justify-content:flex-start;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin: 2rem 0 1rem;
}

.search-form{

    display:none;

    flex-direction:column;

    gap:15px;

    max-width:550px;

    padding:20px;

    margin-bottom:25px;

    border:1px solid #ddd;

    border-radius:8px;

    background:#fafafa;
}

.search-row{

    display:flex;

    align-items:center;

    gap:20px;
}

.search-row label{

    width:100px;

    font-weight:600;
}

.search-row input,
.search-row select{

    flex:1;

    padding:8px 10px;

    border:1px solid #ccc;

    border-radius:6px;
}

.search-actions{

    display:flex;

    justify-content:flex-end;

    gap:10px;

    margin-top:10px;
}

.table-container {
    width: 100%;
    overflow-y: auto;
    overflow-x: auto;
}

.table {
    width: 100%;

    border-collapse: collapse;
}

.table th,
.table td {
    padding: .85rem;

    border: 1px solid #ddd;

    text-align: left;

    white-space: nowrap;
}

.table th {
    background: #f4f4f4;
}

.table tbody tr:hover {
    background: #fafafa;
}

.table-empty {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.badge{
    display:inline-block;

    padding:3px 8px;

    border-radius:12px;

    font-size:.8rem;

    font-weight:600;

    margin-bottom:4px;
}

.badge-success{
    background:#d4edda;
    color:#155724;
}

.badge-danger{
    background:#f8d7da;
    color:#721c24;
}

.badge-warning{
    background:#fff3cd;
    color:#856404;
}

/* ===========================
   Detalles licencia
   =========================== */

.details-grid{
    display:grid;
    grid-template-columns:180px 1fr;
    gap:12px 20px;
    margin:2rem 0;
}

.detail-label{
    font-weight:bold;
}

.details-grid > div:nth-child(2n){
    word-break:break-all;
}

@media (max-width: 700px){

    .header-menu{
        gap: 12px;
        align-items: center;
    }

    .nav{
        gap: .75rem;
        flex-wrap: wrap;
    }

    .nav a,
    .header-right a{
        font-size: .9rem;
        padding: .2rem 0;
    }

    .header-right .button{
        padding: .45rem .7rem;
        font-size: .85rem;
    }

}
