/* public/styles.css */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Roboto, sans-serif;
}

body {
    background: radial-gradient(circle at top left, #1f2933, #0b1015);
    color: #e5e7eb;
    min-height: 100vh;
}

/* LOGIN */

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

.login-card {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 16px;
    padding: 32px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.logo-title {
    text-align: center;
    margin-bottom: 24px;
}

.logo-title span.brand {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-title span.brand-main {
    color: #38bdf8;
}

.logo-title span.brand-sub {
    color: #f97316;
}

.logo-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 4px;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #cbd5f5;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
    font-size: 14px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
    background: #020617;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-small {
    border-radius: 999px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn-primary {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    color: white;
}

.btn-secondary {
    background: #1f2937;
    color: #e5e7eb;
}

.btn-danger {
    background: #b91c1c;
    color: white;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-small:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.error-message {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fecaca;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #bbf7d0;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* LAYOUT */

.topbar {
    background: #020617;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.topbar .brand {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 18px;
}

.topbar .brand span {
    color: #38bdf8;
}

.topbar .user-info {
    font-size: 14px;
    color: #9ca3af;
}

.topbar a {
    color: #f97316;
    text-decoration: none;
}

.main-layout {
    display: flex;
    min-height: calc(100vh - 50px);
}

.sidebar {
    width: 230px;
    background: #020617;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    padding: 16px 12px;
}

.sidebar h3 {
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.nav-section {
    margin-bottom: 18px;
}

.sidebar a.nav-item {
    display: block;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 13px;
    color: #e5e7eb;
    text-decoration: none;
    margin-bottom: 4px;
    transition: background 0.15s, transform 0.1s;
}

.sidebar a.nav-item:hover {
    background: #111827;
    transform: translateX(1px);
}

.sidebar a.nav-item.active {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.content {
    flex: 1;
    padding: 20px 24px;
}

/* DASHBOARD */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.card {
    border-radius: 16px;
    padding: 18px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.14;
    background: radial-gradient(circle at top right, #ffffff, transparent 60%);
}

.card-title {
    font-size: 14px;
    opacity: 0.9;
}

.card-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 8px;
}

.card-meta {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.9;
}

.card-purple { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.card-green  { background: linear-gradient(135deg, #16a34a, #22c55e); }
.card-pink   { background: linear-gradient(135deg, #ec4899, #db2777); }
.card-blue   { background: linear-gradient(135deg, #0ea5e9, #2563eb); }

.section-title {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
}

.section-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
}

/* TABLES */

.table-wrapper {
    margin-top: 10px;
    border-radius: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.85);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed; /* Para que las columnas no estiren la pantalla por URLs largas */
}

th, td {
    padding: 8px 10px;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: anywhere; /* Romper URLs o textos muy largos dentro de la celda */
}

th {
    background: rgba(15, 23, 42, 0.95);
    color: #9ca3af;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.85);
}

tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.7);
}

td.actions {
    white-space: nowrap;
}

/* FORMS */

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
}

.form-inline .form-group {
    margin-bottom: 0;
}

textarea {
    min-height: 70px;
}
