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

*,*::before,*::after{
box-sizing:border-box;
}

/* LOGIN */

.login-container{
background:#1e293b;
padding:40px;
border-radius:20px;
width:90%;
max-width:400px;
text-align:center;
margin:auto;
margin-top:10vh;
}

.login-container img{
display:block;
width:min(92vw,420px);
max-width:100%;
height:auto;
margin-bottom:12px;
margin-left:auto;
margin-right:auto;
padding:10%;
background:#ffffff;
border-radius:8px;
}

input{
width:100%;
padding:14px;
margin-top:12px;
border-radius:10px;
border:1px solid #334155;
background:#0b1220;
color:#e2e8f0;
}

.password-wrap{
position:relative;
width:100%;
}

.password-wrap input{
padding-right:96px;
}

.toggle-password{
position:absolute;
right:8px;
top:18px;
padding:7px 10px;
font-size:13px;
border-radius:6px;
background:#334155;
}

select{
width:100%;
padding:14px;
margin-top:12px;
border-radius:10px;
border:1px solid #334155;
background:#0b1220;
color:#e2e8f0;
}

input::placeholder{
color:#94a3b8;
}

.hidden{
display:none;
}

button{
background:#2563eb;
color:white;
padding:12px 16px;
border:none;
border-radius:8px;
font-size:16px;
font-weight:bold;
cursor:pointer;
}

#loginForm > button[type="submit"]{
margin-top:14px;
}

.form-link{
margin-top:18px;
font-size:14px;
}

.form-link a{
color:#60a5fa;
text-decoration:none;
font-weight:600;
}

.form-link a:hover{
text-decoration:underline;
}

.form-message{
margin:8px 0 14px 0;
padding:10px 12px;
border-radius:8px;
font-size:14px;
text-align:left;
}

.form-message.error{
background:#7f1d1d;
color:#fee2e2;
border:1px solid #ef4444;
}

.form-message.success{
background:#14532d;
color:#dcfce7;
border:1px solid #22c55e;
}

/* DASHBOARD */

.container{
width:95%;
max-width:1200px;
margin:auto;
padding:20px;
}

.cards{
display:flex;
gap:20px;
margin-bottom:30px;
flex-wrap:wrap;
}

.card{
background:#1e293b;
padding:20px;
border-radius:12px;
flex:1;
min-width:200px;
}

.card h3{
margin:0 0 10px 0;
}

.upload{
background:#1e293b;
padding:20px;
border-radius:12px;
margin-bottom:30px;
}

/* TABELA */

table{
width:100%;
border-collapse:collapse;
background:#1e293b;
border-radius:12px;
overflow:hidden;
}

th,td{
padding:12px;
text-align:left;
}

th{
background:#020617;
}

tr:nth-child(even){
background:#0f172a;
}

/* BOTÕES TABELA */

.acoes button{
padding:8px 12px;
font-size:16px;
margin:2px;
border:none;
border-radius:6px;
cursor:pointer;
}

.btn-ver{
background:#3498db;
color:white;
}

.btn-editar{
background:#f39c12;
color:white;
}

.btn-apagar{
background:#e74c3c;
color:white;
}

/* Actions dropdown container */
.acoes-linha{
		position:relative;
}
.acoes-dropdown-wrap{
	position:relative;
	display:inline-block;
}
.acoes-dropdown{
	position:absolute;
	right:0;
	top:36px;
	background:#1e293b;
	border:1px solid #334155;
	border-radius:6px;
	padding:8px;
	display:none;
	z-index:1000;
	min-width:120px;
	box-shadow:0 6px 18px rgba(2,6,23,0.6);
}
.acoes-dropdown button{
	display:block;
	width:100%;
	text-align:left;
	padding:6px 8px;
	margin:0 0 6px 0;
}
.acoes-dropdown button:last-child{ margin-bottom:0 }

/* Reduce number font-size for value columns to avoid button clipping */
table td:nth-child(3),
table td:nth-child(4),
table td:nth-child(5){
	font-size:13px;
}

/* RESPONSIVO */

@media(max-width:700px){
	th:nth-child(6),
	td:nth-child(6){
	width:80px;
	min-width:70px;
	word-break:break-word;
	white-space:normal;
	padding-right:2px;
	font-size:10px;
	text-align:center;
	}

	th:nth-child(3),
	td:nth-child(3){
	word-break:break-word;
	white-space:normal;
	font-size:10px;
	}

	/* ensure numbers remain small on narrow screens */
	table td:nth-child(3),
	table td:nth-child(4),
	table td:nth-child(5){
		font-size:11px;
	}

	/* keep numeric table cells on one line on mobile */
	table td:nth-child(3),
	table td:nth-child(4),
	table td:nth-child(5){
		white-space:nowrap;
		overflow:hidden;
		text-overflow:ellipsis;
		font-size:12px;
		padding-right:6px;
	}

/* Hide 'Sem IVA' column on desktop (avoid layout/clipping issues) */
@media(min-width:701px){
    table th:nth-child(5),
    table td:nth-child(5){
        display:none;
    }
}

	th,
	td{
	max-width:90px;
	overflow-wrap:break-word;
	}
table{
font-size:14px;
}

.acoes button{
padding:12px;
font-size:20px;
}

}

/* Export modal styles */
#exportModal, #exportModalRel {
	display: none; /* shown via inline style or JS */
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	background: rgba(2,6,23,0.6);
	z-index: 9999;
}

#exportModal > div, #exportModalRel > div {
	background: #0b1220;
	color: #e6eef8;
	padding: 20px;
	border-radius: 10px;
	width: min(92%, 460px);
	box-shadow: 0 12px 40px rgba(2,6,23,0.6);
	border: 1px solid rgba(99,102,241,0.06);
}

#exportModal h3, #exportModalRel h3 {
	margin: 0 0 12px 0;
	font-size: 18px;
	display: flex;
	align-items: center;
	gap: 10px;
}

#exportModal label, #exportModalRel label {
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	transition: background .12s ease, transform .06s ease;
}

#exportModal label:hover, #exportModalRel label:hover {
	background: rgba(255,255,255,0.02);
}

#exportModal input[type="radio"], #exportModalRel input[type="radio"]{
	transform: scale(1.05);
}

#exportModal .actions, #exportModalRel .actions{
	margin-top: 14px;
	text-align: right;
}

#exportModal button, #exportModalRel button{
	padding: 8px 12px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
}

#exportModal button.cancel, #exportModalRel button.cancel{
	background: transparent;
	color: #94a3b8;
	border: 1px solid #334155;
	margin-right: 8px;
}

#exportModal button.confirm, #exportModalRel button.confirm{
	background: #0f172a;
	color: #fff;
}

@media(max-width:480px){
	#exportModal > div, #exportModalRel > div { padding: 14px; }
	#exportModal h3, #exportModalRel h3 { font-size:16px }
}

/* Mobile: keep the summary cards horizontal and allow wide numbers (up to 9 digits) */
@media(max-width:700px){
	.cards{
		display:flex;
		flex-wrap:nowrap;
		gap:12px;
		overflow-x:auto;
		padding-bottom:6px;
	}
	.card{
		flex:0 0 auto;
		/* larger min-width to fit up to 9 digits without wrapping */
		min-width:260px;
		max-width:320px;
		display:flex;
		align-items:center;
		justify-content:space-between;
	}
	.card h3{
		margin:0;
		font-size:13px;
		white-space:nowrap;
		margin-right:8px;
	}
	.card h2{
		margin:0;
		font-size:16px;
		white-space:nowrap;
		font-variant-numeric: tabular-nums;
		letter-spacing:0.5px;
	}
}

/* Mobile-specific tweaks for actions dropdown (touch-friendly) */
@media(max-width:700px){
	.acoes-linha{ display:flex; gap:8px; align-items:center; }
	.acoes-dropdown{ position:static; right:auto; top:auto; box-shadow:none; border:1px solid rgba(255,255,255,0.03); margin-top:6px; padding:8px; min-width:160px; }
	.acoes-dropdown button{ padding:10px 12px; font-size:16px; }
	.btn-acoes{ padding:10px 12px; font-size:15px; }
}

/* Prevent header 'Total' and currency symbol from wrapping (keep on one line) */
th.col-total, th.col-total * {
	white-space:nowrap !important;
	word-break:normal !important;
}
/* Ensure total column cells don't wrap the currency or split into two lines */
table td:nth-child(3), table td:nth-child(3) * {
	white-space:nowrap !important;
	word-break:normal !important;
}